Making Triangle in matlab
8 ビュー (過去 30 日間)
古いコメントを表示
How do I make the triangle without plotting function like that?

0 件のコメント
回答 (2 件)
KSSV
2020 年 4 月 30 日
m = 100;
n = 2*m;
I = zeros(m,n) ;
for i = 1:m-1
idx = (n/2-i):(n/2+i) ;
I(i,idx)= 1 ;
end
imshow(I)
5 件のコメント
Image Analyst
2022 年 7 月 18 日
You can use poly2mask
x = [100, 200, 300]; % Left vertex, top vertex, right vertex.
y = [300, 100, 300]; % Left vertex, top vertex, right vertex.
mask = poly2mask(x, y, 400, 400);
imshow(mask);
axis on
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Labels and Annotations についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

