for loop in MATLAB function block

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일

0 개 추천

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

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

릴리스

R2019a

질문:

2020년 2월 23일

댓글:

2020년 2월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by