how to plot geometric figures?
53 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
bsd
am 29 Aug. 2011
Kommentiert: Badriah Al-Juaid
am 27 Okt. 2019
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
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 29 Aug. 2011
Consider also patch()
rectangle() can be used to plot squares, rectangles, ellipses, and circles.
0 Kommentare
Weitere Antworten (4)
Honglei Chen
am 29 Aug. 2011
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
0 Kommentare
ali cherif abdelkader
am 17 Feb. 2018
hello brother, you can use GeoGebra app and copy the coordinate of your shape from GeoGebra to matlab one by one.
1 Kommentar
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!