Why wont matlab plot my equations?

2 ビュー (過去 30 日間)
Lynsey King
Lynsey King 2021 年 2 月 3 日
回答済み: Walter Roberson 2021 年 2 月 3 日
loglog(x,y1,'r',x,y2,'b')
x=logspace(-1,6);
y1=((24./R_e)+(1./1+sqrt(R_e))+0.4);
y2=(24./R_e).*(1+0.27*R_e).^0.43+0.47.*1-exp(-0.04*R_e.^0.38);

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 2 月 3 日
Your equation is independent of x.
R_e = linspace(-5,5).';
y1 = ((24./R_e)+(1./1+sqrt(R_e))+0.4);
y2 = (24./R_e).*(1+0.27*R_e).^0.43+0.47.*1-exp(-0.04*R_e.^0.38);
subplot(2,1,1); plot(R_e, real(y1), 'b', R_e, imag(y1), 'r'); title('y1'); xlabel('R_e'); ylim([-10 10])
subplot(2,1,2); plot(R_e, real(y2), 'b', R_e, imag(y2), 'r'); title('y2'); xlabel('R_e'); ylim([-10 10])

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by