필터 지우기
필터 지우기

how to plot geometric figures?

조회 수: 109 (최근 30일)
bsd
bsd 2011년 8월 29일
댓글: Badriah Al-Juaid 2019년 10월 27일
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

채택된 답변

Walter Roberson
Walter Roberson 2011년 8월 29일
Consider also patch()
rectangle() can be used to plot squares, rectangles, ellipses, and circles.

추가 답변 (4개)

Honglei Chen
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
Florin Neacsu 2011년 8월 29일
Hello,
You might want to have a look at geom2d on the file exchange.
Regards, Florin

ali cherif abdelkader
ali cherif abdelkader 2018년 2월 17일
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
Badriah Al-Juaid 2019년 10월 27일
hi , could you please explain GeoGebra / what is it ?

댓글을 달려면 로그인하십시오.


Steven Lord
Steven Lord 2018년 2월 17일
If you're using release R2017b or later, use the polyshape function.

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by