HOW DRAW THIS SHAPE

2 ビュー (過去 30 日間)
iman
iman 2014 年 7 月 27 日
コメント済み: Image Analyst 2014 年 7 月 27 日
i want to draw this shape but i can not draw Triangle. how i can draw a triangle in matlab?

回答 (1 件)

Image Analyst
Image Analyst 2014 年 7 月 27 日
Use the line() function. No, I don't know the (x,y) coordinates of the endpoints - you'll have to figure that out yourself. You can display your image and say "axis on" to get some idea of what the locations would be.
  3 件のコメント
Image Analyst
Image Analyst 2014 年 7 月 27 日
iman's so-called "Answer" moved here:
can you draw a triangle for me with line function ?for example
Image Analyst
Image Analyst 2014 年 7 月 27 日
Try this:
x = [1 2 3];
y = [1 2 1];
line([x(1), x(2)], [y(1), y(2)], 'Color', 'b', 'LineWidth', 3);
hold on;
line([x(2), x(3)], [y(2), y(3)], 'Color', 'b', 'LineWidth', 3);
line([x(3), x(1)], [y(3), y(1)], 'Color', 'b', 'LineWidth', 3);
grid on;
ylim([0, 3]);
axis equal;

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by