creatting a polygon in matlab
조회 수: 3 (최근 30일)
이전 댓글 표시
hi
im going to create a polygon that is combination with points and function.
look at this picture
fourmula of top function is : y = 10+1*exp((-(x-15).^2)/10);
i want to creat a polygon the hatched figured
please help, thanks
댓글 수: 0
채택된 답변
Matteo Lo Preti
2020년 10월 4일
x = linspace(0,30,50);
y = 10+1*exp((-(x-15).^2)/10);
x = [30 30 0 x];
y = [10 0 0 y];
warning('off', 'MATLAB:polyshape:repairedBySimplify')
polygon = polyshape(x,y);
figure;
plot(polygon);
댓글 수: 2
추가 답변 (1개)
Alan Stevens
2020년 10월 4일
You could also use the patch function
x = [0 0:30 30 0];
y = [0 10+exp((-(x(2:end-2)-15).^2)/10) 0 0];
patch(x,y,'r')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Elementary Polygons에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!