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 个评论
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