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')

采纳的回答

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