plot subset of data

조회 수: 27 (최근 30일)
michael
michael 2020년 5월 11일
답변: KSSV 2020년 5월 11일
Hello,
(I'm using some old matlab :( )
I have a vector with 1000 values. From this values, I'd like to filter based on some value and then plot it as 'events'
For example, I have some numbers between 0 and 2*pi. I'd like to filter all values greater than 4 and plot them with x base 1:1000.
I'd be glad to have some clues.

채택된 답변

KSSV
KSSV 2020년 5월 11일
Let x,y be your values. Where x = 1:1000 and y lies in [0, 2*pi] ;
idx = y>4 ; % get indices of y which are greater than four
plot(x(idx),y(idx)) % plot

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

제품


릴리스

R14SP1

Community Treasure Hunt

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

Start Hunting!

Translated by