how to plot data saved as file using "TO FILE" block in Simulink

Please help me for this. how to plot data saved as file using "TO FILE" block in Simulink. Thank you in advance

Antworten (1)

Paulo Silva
Paulo Silva am 7 Apr. 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,:))

Kategorien

Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange

Produkte

Gefragt:

am 7 Apr. 2011

Kommentiert:

am 14 Jun. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by