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
답변 (1개)
Paulo Silva
2011년 4월 7일
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
Maryam saeed
2021년 6월 14일
what to do if this input file itself is showing error?
카테고리
도움말 센터 및 File Exchange에서 Simulink에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!