At Image or others: Distance from points to point.

2 ビュー (過去 30 日間)
Francesco
Francesco 2014 年 2 月 9 日
編集済み: Francesco 2014 年 3 月 22 日
The first part of the code is this one:

採用された回答

Image Analyst
Image Analyst 2014 年 2 月 9 日
I thought I already showed you in your duplicate question http://www.mathworks.com/matlabcentral/answers/115335#comment_195217. I don't know what gplot() is - I never use it. I showed you how you could use plot() to pass in a color. You just need to assign the color. For example
if distance > gvar(i)
plot(x,y, 'ro-'); % Plot red circles.
else
plot(x,y, 'bs-'); % Plot blue squares.
end
By the way, your loop over i and j is calculating all the distances twice, unlike how I showed you. The distance from point 1 to point 3 is the same as from point 3 to point 1 so why calculate it again?
  6 件のコメント
Francesco
Francesco 2014 年 2 月 9 日
??? Attempted to access val_mag(9); index out of bounds because numel(val_mag)=3.
Now there is this error code line.
Image Analyst
Image Analyst 2014 年 2 月 9 日
Well how did the index get to 9? Are you using the debugger at all? Or just wanting me to download your code and data and have me debug it for you?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by