how to plot data saved as file using "TO FILE" block in Simulink
Mostrar comentarios más antiguos
Please help me for this. how to plot data saved as file using "TO FILE" block in Simulink. Thank you in advance
Respuestas (1)
Paulo Silva
el 7 de Abr. de 2011
That depends on the data, the To File block writes data as a matrix of two or more rows. The block writes one column to the MAT-file for each time step. The first element of the column contains the simulation time. The remainder of the column contains scalar or vector data for the time shown at the top of the column.
For example if you save to one mysimdata.mat file and use the variable ans for the ouput:
load('mysimdata') %load the saved data
s=2; %second row got the signal
plot(ans(1,:),ans(s,:)) %first row is the time
if you got more signals in there
s=3; %third row got the data you want to plot
plot(ans(1,:),ans(s,:))
more signals just add one to s and plot it
plot(ans(1,:),ans(s,:))
1 comentario
Maryam saeed
el 14 de Jun. de 2021
what to do if this input file itself is showing error?
Categorías
Más información sobre Simulink en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!