Plot with 2 parameters

2 ビュー (過去 30 日間)
Hakan Güngör
Hakan Güngör 2021 年 1 月 9 日
コメント済み: Hakan Güngör 2021 年 1 月 12 日
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 日
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 件のコメント
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

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by