How do I find the coordinates inside a rectangle or triangle?

13 ビュー (過去 30 日間)
Ruslan Khoguev
Ruslan Khoguev 2018 年 12 月 4 日
回答済み: Bruno Luong 2018 年 12 月 4 日
How would I go about finding the coordinates for random points inside this rectangle?
This is the code used:
n=20;
x=linspace(-1,1,n);
y=linspace(-1,1,n);
[x,y]=meshgrid(x,y);
z=zeros(n);
for i=1:n
for j=1:n
[N A] = acm_N([x(i,j) y(i,j)],[-1 -1; 1 -1; 1 1; -1 1],acm_def);
z(i,j)=N(10);
end
end
surf(x,y,z);

回答 (1 件)

Bruno Luong
Bruno Luong 2018 年 12 月 4 日
INTERP2

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by