for loop in MATLAB function block

7 ビュー (過去 30 日間)
Lau Boon Chong
Lau Boon Chong 2020 年 2 月 23 日
コメント済み: Lau Boon Chong 2020 年 2 月 27 日
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 件のコメント
Jakob B. Nielsen
Jakob B. Nielsen 2020 年 2 月 24 日
Can you post the error? The code ought to run just fine.

サインインしてコメントする。

回答 (1 件)

Nishant Gupta
Nishant Gupta 2020 年 2 月 26 日
Hi,
You can refer to the model attached here.
  1 件のコメント
Lau Boon Chong
Lau Boon Chong 2020 年 2 月 27 日
Hi Nishant Gupta
Thank for solving my problem. Have a nice day

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by