Azzera filtri
Azzera filtri

for loop in MATLAB function block

3 visualizzazioni (ultimi 30 giorni)
Lau Boon Chong
Lau Boon Chong il 23 Feb 2020
Commentato: Lau Boon Chong il 27 Feb 2020
Hi All
I want to run a simple for loop a shown below:
for i = 1:4
x(i) = rand(1,1);
end
The function block shows error. Any idea to run for such for loop in MATLAB function block as I need this for loop to write a long code? Thank you
  1 Commento
Jakob B. Nielsen
Jakob B. Nielsen il 24 Feb 2020
Can you post the error? The code ought to run just fine.

Accedi per commentare.

Risposte (1)

Nishant Gupta
Nishant Gupta il 26 Feb 2020
Hi,
You can refer to the model attached here.
  1 Commento
Lau Boon Chong
Lau Boon Chong il 27 Feb 2020
Hi Nishant Gupta
Thank for solving my problem. Have a nice day

Accedi per commentare.

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Prodotti


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by