Filtering coordinats, and marking them
조회 수: 1 (최근 30일)
이전 댓글 표시
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')
댓글 수: 0
채택된 답변
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
2014년 2월 19일
Good point. Mis-interpreted, probably just wanted to go with a standard marker.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!