Filtering coordinats, and marking them

조회 수: 1 (최근 30일)
Rasmus
Rasmus 2014년 2월 19일
댓글: Mischa Kim 2014년 2월 19일
Yeah so I am new with Mathlab - So i was wondering how to mark every data coordinats with 'go', that is 1 unit length from (-1,-1).
I know i need to make a filter of a sort, but it doesnt quiet work.
What i type is the following:
>> filter= -2>y>0 & -2>x>0
>> plot(x(filter),y(filter),'go')

채택된 답변

Image Analyst
Image Analyst 2014년 2월 19일
'go' in plot means plot green circles at the data points with no lines connecting the data points. I don't know if you want the word "go" or if you want green circles. I don't know why you'd want the word go near every data point but if you do, follow Mischa's code. But the "1 unit length from (-1,-1)" is the thing I'm confused about. What does that mean? Do you want a scale bar in your plot, like a "micron bar" they use in microscopy images?
Your filter will select only those data points that fit in the box from -2 to 0 in the y direction and from -2 to 0 in the x direction. But you're using the wrong syntax. You need to do:
filterLogicalIndexes = -2<y & y<0 & -2<x & x < 0;
plot(x(filterLogicalIndexes ),y(filterLogicalIndexes ),'go', 'MarkerSize', 10, 'LineWidth', 2);
  댓글 수: 1
Mischa Kim
Mischa Kim 2014년 2월 19일
Good point. Mis-interpreted, probably just wanted to go with a standard marker.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by