To Workspace Block - Output Array Size Problem

조회 수: 3 (최근 30일)
Nayif Kandemir
Nayif Kandemir 2019년 11월 13일
댓글: Fangjun Jiang 2019년 11월 13일
Hello,
I am working on a script that runs a simulink model that gets inputs from the script and forwards the output to the workspace. However, even though the input is a constant value, the output results in a 51*1 size array. Is there any chance to change the size of the output as a 1*1 array (like a constant value)?
Best regards

채택된 답변

Fangjun Jiang
Fangjun Jiang 2019년 11월 13일
편집: Fangjun Jiang 2019년 11월 13일
A Simulink simulation runs for a period of time. The output being 51x1 size array probably means the simulation ran for 50 steps. You could change the time to make it run just one step but that would not be a typical Simulink simulation. Maybe you just need to make it a MATLAB function dealing with input and output.
  댓글 수: 2
Nayif Kandemir
Nayif Kandemir 2019년 11월 13일
I created the simulink model since it is harder to code it on MATLAB. I am aware of that it is not the most efficient way to use a simulink model, not even close but since I am not that familiar with simulink, I am trying to run the model iteratively from workspace.
So, how can I change the number of steps, then?
Fangjun Jiang
Fangjun Jiang 2019년 11월 13일
Set the Solver, Step time, Stop time
Or just click "Step Forward" once/twice and then Stop.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by