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 Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by