Filtering coordinats, and marking them

1 view (last 30 days)
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')

Accepted Answer

Image Analyst
Image Analyst on 19 Feb 2014
'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 Comment
Mischa Kim
Mischa Kim on 19 Feb 2014
Good point. Mis-interpreted, probably just wanted to go with a standard marker.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!