フィルターのクリア

What am I missing with plot? math is working fine, just need to plot it.

1 回表示 (過去 30 日間)
Francis Segesman
Francis Segesman 2021 年 9 月 28 日
回答済み: Chunru 2021 年 9 月 28 日
clear all;clc;
syms theta v omega omega1
% Given
mu0=3.63*10^(-7);
T=30;
T0=518.7;
s=198.72;
while T<110
mu1 = mu0*(((T+459.67)/T0)^(1.5)) * ((T0+s)/((T+459.67)+s));
T=T+10;
fprintf("%e\n",mu1);
x=T;
y=mu1;
hold on
plot(x,y);
end
fprintf("More collisions in a gas means more momentum transfer making the gas more viscous.",mu1);
hold off

採用された回答

Chunru
Chunru 2021 年 9 月 28 日
For ervery loop, you have only one point (x,y) which you can not plot as a line. Use plot(x, y, 'bo') to plot the point instead. If you want to join the dots, you need to store the (x,y) values over the loop.
clear all;clc;
syms theta v omega omega1
% Given
mu0=3.63*10^(-7);
T=30;
T0=518.7;
s=198.72;
while T<110
mu1 = mu0*(((T+459.67)/T0)^(1.5)) * ((T0+s)/((T+459.67)+s));
T=T+10;
fprintf("%e\n",mu1);
x=T;
y=mu1;
hold on
plot(x,y, 'bo');
end
3.469976e-07 3.525597e-07 3.580692e-07 3.635272e-07 3.689350e-07 3.742935e-07 3.796040e-07 3.848674e-07
fprintf("More collisions in a gas means more momentum transfer making the gas more viscous.",mu1);
More collisions in a gas means more momentum transfer making the gas more viscous.
hold off

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by