How to draw a simple triangle?
320 次查看(过去 30 天)
显示 更早的评论
I want to draw two simple triangles, (equilateral triangles). Then when i will click on one of the triangle and it will save its values in any file e.g Excel sheet. so any one can help it would be pleasure. Thanks in advance.
My Matlab level is moderate. i dont know too much about it.
Note: I know how to save values in excel. but don't know other stuff.
0 个评论
回答(3 个)
Konstantin Ninidze
2021-4-13
编辑:Image Analyst
2021-4-13
Try this:
p = nsidedpoly(3, 'Center', [1 ,1], 'SideLength', 1);
plot(p);
2 个评论
Daniel Arreguìn
2021-12-28
If you use the same example must be:
p_rotated=rotate(p,theta,rotation_center)
plot(p_rotated)
Image Analyst
2014-11-23
You can use line or plot.
line([x1,x2], [y1, y2], 'Color', 'r');
hold on;
line([x2,x3], [y2, y3], 'Color', 'r');
line([x3,x1], [y3, y1], 'Color', 'r');
% get user input
[x, y] = ginput(1);
if inpolygon(..............
and so on.
0 个评论
Muhammad Ali kiani
2019-11-25
i want to draw triangles in rectangle ?? can any one guide me in this regard
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Exploration 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!