how to plot geometric figures?
显示 更早的评论
Dear sir/madam,
I am working on geometric shapes. I need to plot geometric shapes like square, rectangle, triangle etc... in matlab. How could I do this in matlab? Looking forward to hearing from you soon.
Thanking you, BSD
采纳的回答
更多回答(4 个)
Honglei Chen
2011-8-29
You can just give the coordinates for each vertex, e.g., for square
plot([0 1 1 0 0],[0 0 1 1 0])
If you don't want the axes, you can do
axis off
If you want to be fancy, you can wrap the above code in a function and take the width as the input and then calculate the vertex coordinates inside the function.
HTH
Florin Neacsu
2011-8-29
0 个投票
ali cherif abdelkader
2018-2-17
0 个投票
hello brother, you can use GeoGebra app and copy the coordinate of your shape from GeoGebra to matlab one by one.
1 个评论
Badriah Al-Juaid
2019-10-27
hi , could you please explain GeoGebra / what is it ?
Steven Lord
2018-2-17
0 个投票
类别
在 帮助中心 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!