How make separate plots of one timeseries
Ältere Kommentare anzeigen
I have a Simulink model which outputs a timeseries 'y_ss' to the workspace. The timeseries 'y_ss' contains three columns of data: each column corresponds to a state of my system. I want to make a plot for each column of data separately so that I can see the behavior of each state of my system. I've tried the following code to plot my first state (first data column) by itself:
clear all;
sim('HW2_P5model');
figure;
hold on;
plot(y_ss.Data:1),'b-');
xlabel('Time (sec)');
ylabel('Current (A)');
title('RLC Circuit Simulation');
legend('i_{L2}');
This doesn't give me anything at all. How can I plot each of the data columns individually in its own figure?
Thanks,
DMF
1 Kommentar
Azzi Abdelmalek
am 15 Jun. 2015
What is the size of y_ss.Data. Type
size(y_ss.Data)
Antworten (1)
Azzi Abdelmalek
am 15 Jun. 2015
Bearbeitet: Azzi Abdelmalek
am 15 Jun. 2015
If the size of y_ss is nx3
sim('HW2_P5model')
time=y_ss.Time
y1=y_ss(:,1)
y2=y_ss(:,2)
y3=y_ss(:,3)
plot(t,y1,t,y2,t,y3)
2 Kommentare
David
am 15 Jun. 2015
Azzi Abdelmalek
am 15 Jun. 2015
Bearbeitet: Azzi Abdelmalek
am 15 Jun. 2015
What is the size of y_ss.Data? and avoid using clear all
Kategorien
Mehr zu Time Series finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!