Filter löschen
Filter löschen

line plot of events with value

1 Ansicht (letzte 30 Tage)
Mech Princess
Mech Princess am 26 Okt. 2012
I want to plot TEST values (amplitude) against the given time in TEST_TS. Then I want to plot vertical lines at given times of ttss.
example code is given below
TEST_TS = (1:10)';
TEST = [5 -1 8 10 -4 -2 7 0 -2 1]';
ttts = [2.5 3 9.2 1 8]';
for i=1:10
line([TEST_TS(i) TEST_TS(i)],[TEST(i,1) 0]); hold on
end
yL = get(gca,'YLim');
line([ttts ttts],yL,'Color','r');
Now my issue is that when my data vector is long (200,000 points) it takes forever for the plot to come out. I have several such plots in my code.
If I plot the first using "stem" it gives an error when I try to plot ttss using plot or line.
Does anyone know an efficient way to do this? Thanks

Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by