sim('') command with supressed ";" still displays a variable on command window (it's spamming it)

조회 수: 1 (최근 30일)
I am currently trying to run a number of different load cases in a simulink model, and I thus use the "sim('model')" command in a for loop. My code is seen below
LoadCases = [30, 31];
idx = 1;
for i = LoadCases
LoadCase = i;
sim('WPSCMM82_IEC_Simulations_V009_lima_23_nov_2020');
KeyData{idx} = KeyDataDisplay.signals.values(end,:)';
for k = 1:size(KeyDataScope.signals,2)
scopedata(:,k) = KeyDataScope.signals(k).values;
end
TimeSeriesData{idx} = scopedata;
idx = idx + 1;
end
Where LoadCases is the variable in the simulink model I change for each loop. The data variables are just used for logging the data that I save to workspace. This functions just fine. The problem is, even with the suppresion ";" on the sim command, my command windown is spammed with a display of a variable, that I have no idea what is, or where it belongs (see fig). This happens while my simulation is running. I am trying to get rid of it - any ideas?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2020년 11월 27일
You need to go to your Simulink model to find the source of the assignment line "y=something" where ";" is not present. It could be in a MATLAB Function block, or a Stateflow chart.
  댓글 수: 3
Fangjun Jiang
Fangjun Jiang 2020년 11월 30일
try Ctrl+F to do a blind search for "y =". Good luck!
Rasmus Visgaard
Rasmus Visgaard 2020년 11월 30일
편집: Rasmus Visgaard 2020년 11월 30일
Alright, so I opened up Model Explorer in Simulink, which gives me a long list of all subsystems and Matlab functions. I looked through each and everyone of them, and all the functions that contain "y = something" has ";" after it. So it cannot be the source. Do you have any other tip?
EDIT: Nevermind. I looked for outputs only, but should have looked at each function block to see if there was an internal variable called y. There happened to be, so I now fixed the problem.
Thanks alot Fangjun!

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by