フィルターのクリア

line plot of events with value

1 回表示 (過去 30 日間)
Mech Princess
Mech Princess 2012 年 10 月 26 日
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

回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by