syms r teta x y
teta= -90: 0.1: 90;
r= 0.5:0.1:1.5;
x=sind(teta).*r;
y=cosd(teta).*r;
plot(x,y)
that my code, I want to see a plot like half disc with a hole but it doesnt work :(

답변 (1개)

Alan Stevens
Alan Stevens 2021년 1월 9일

1 개 추천

Do you mean something like this:
theta = -90:90;
ri = 0.5; ro = 1.5;
x = [ri*cosd(theta) ro*cosd(-theta) 0];
y = [ri*sind(theta) ro*sind(-theta) ri*sind(theta(1))];
plot(x,y), axis equal

댓글 수: 3

Hakan Güngör
Hakan Güngör 2021년 1월 12일
It works for my hw thanks. But I mean I want my plot with not only 2 r value (ri,ro). I want to see my plot with r:0.5:0.1:1.5; (means 10 value or more). What should I do? Do I need a for loop?
Alan Stevens
Alan Stevens 2021년 1월 12일
Yes, use a for loop. You haven't said if the values from 0.5 to 1.5 refer to ri or ro. Presumably you need to specify values for both.
Hakan Güngör
Hakan Güngör 2021년 1월 12일
thanks mate

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

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

제품

태그

질문:

2021년 1월 9일

댓글:

2021년 1월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by