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

1 visualización (últimos 30 días)
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?

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 27 de Nov. de 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 comentarios
Rasmus Visgaard
Rasmus Visgaard el 30 de Nov. de 2020
Editada: Rasmus Visgaard el 30 de Nov. de 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!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by