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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by