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

1 view (last 30 days)
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?

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 27 Nov 2020
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 Comments
Rasmus Visgaard
Rasmus Visgaard on 30 Nov 2020
Edited: Rasmus Visgaard on 30 Nov 2020
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!

Sign in to comment.

More Answers (0)

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products


Release

R2017a

Community Treasure Hunt

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

Start Hunting!