I have a 36x5 matrix. Each column of this matrix is an input to a simulink block. I need to create a for loop for my simulink model using the matrix. For example, the first column of the matrix generates an output from the simulink block, then the second column should do the same and so on. All the output data should be sent to the workspace. What is the best way to generate this for loop? Thanks.

답변 (1개)

KL
KL 2017년 10월 4일

0 개 추천

data = rand(35,1);
time = 1:35;
simulink_variable = timeseries(data,time)
and then use it with a from workspace block. Similarly use a to workspace block to get the outputs?

댓글 수: 1

Juan Nunez
Juan Nunez 2017년 10월 11일
Thanks KL!!. Problem solved using your suggestion.

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

카테고리

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

질문:

2017년 10월 4일

댓글:

2017년 10월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by