필터 지우기
필터 지우기

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 CenterFile Exchange에서 2-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