find values within limits
2 ビュー (過去 30 日間)
古いコメントを表示
I have the equation of a circle:
(x - a)^2 + (y - b)^2 - r^2 = 0
a, b and r are known values and I would like to find the values of x and y from a predetermined coordinate matrix which satisfies the equation.
example: a = 2, b = 2, r = 2
A = 1 2
1 3
2 4
4 2
The coding to do this is:
a = 2; b = 2; r = 2;
B = A((A(:,1)-a).^2+(A(:,2)-b).^2==r^2,:);
then the last two values would satisfy and hence display 2,4 and 4,2.
What I would like to know is how this code would change if i set limits. Say I want to display only the value that is within the limits of +/-1 for a & b.
i.e. it would only display 2,4
0 件のコメント
回答 (1 件)
Image Analyst
2014 年 8 月 26 日
Do you want to create a ring/torus/annulus? If so, see the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_an_ring.3F
4 件のコメント
Image Analyst
2014 年 8 月 26 日
Maybe I'm just dense but that means nothing to me, but a diagram would help me immensely.
参考
カテゴリ
Help Center および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!