フィルターのクリア

How to plot two equation consequetively

1 回表示 (過去 30 日間)
safi58
safi58 2016 年 12 月 7 日
コメント済み: safi58 2016 年 12 月 7 日
Hi, I have written this code and need to plot jlralph and jlrgamma in a continuous way from 0 to alpharange and alpharange to alpharange2 respectively.
mc0 = -0.5;
jlr0 = -0.8;
M = 0.99;
alpharange = 6.5; %// degrees
alpharange2 = 180; %// degrees
mcalpha = (mc0 - (1 / M) - 1) * cos(alpharange) + jlr0 * sin(alpharange) + (1/M) + 1
jlralpha = ((-mc0) + (1 / M) + 1) * sin(alpharange) + jlr0 * cos(alpharange)
for i=0:1:alpharange
jlralph = ((-mc0) + (1 / M) + 1) * sin(i) + jlr0 * cos(i)
for x=alpharange:1:alpharange2
jlrgamma = ((-mcalpha) + (1 / M) - 1) * sin(x- alpharange) + jlralpha * cos(x- alpharange);
end
end
How do I do that

採用された回答

Walter Roberson
Walter Roberson 2016 年 12 月 7 日
mc0 = -0.5;
jlr0 = -0.8;
M = 0.99;
alpharange = 6.5; %// degrees
alpharange2 = 180; %// degrees
mcalpha = (mc0 - (1 / M) - 1) * cosd(alpharange) + jlr0 * sind(alpharange) + (1/M) + 1;
jlralpha = ((-mc0) + (1 / M) + 1) * sind(alpharange) + jlr0 * cosd(alpharange);
%above here I only changed sin to sind and cos to cosd
%below here is vectorized computations. Note sin and cos changed to sind and cosd
alpha1 = linspace(0, alpharange);
jlralph = ((-mc0) + (1 / M) + 1) * sind(alpha1) + jlr0 * cosd(alpha1);
alpha2 = linspace(alpharange, alpharange2);
jlrgamma = ((-mcalpha) + (1 / M) - 1) * sind(alpha2 - alpharange) + jlralpha * cosd( alpha2 - alpharange);
plot([alpha1, alpha2], [jlralph, jlrgamma])
  1 件のコメント
safi58
safi58 2016 年 12 月 7 日
Thank you walter.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by