why this function is not plotting?
1 回表示 (過去 30 日間)
古いコメントを表示
a =5;
T = 2E3;
Z = linspace(0,0.1,0.01);
U = (1+2.*Z)./(2.*a.*T);
plot(Z,U)
0 件のコメント
回答 (1 件)
Star Strider
2022 年 7 月 21 日
Look t the linspace result —
a =5;
T = 2E3;
Z = linspace(0,0.1,0.01)
U = (1+2.*Z)./(2.*a.*T);
plot(Z,U)
a =5;
T = 2E3;
Z = linspace(0,0.1,150) % 'linspace' Now Produces A Vector
U = (1+2.*Z)./(2.*a.*T);
plot(Z,U)
.
3 件のコメント
Star Strider
2022 年 7 月 21 日
Shading between them is straightforward —
% clc
% clear all
a =5;
T = 2E3;
Z = linspace(0,0.1,150);
U = (1+2.*Z)./(2.*a.*T);
V = (a.*Z)./(1+2.*Z);
Lv = Z>0;
UL10 = log10(U(Lv));
VL10 = log10(V(Lv));
figure
patch([Z(Lv) flip(Z(Lv))], [UL10 flip(VL10)], 'g', 'FaceAlpha',0.25)
hold on
plot(Z,log10(U))
plot(Z,log10(V))
hold off
grid on
The use of ‘Lv’ here is to avoid using values of ‘Z’ equal to 0 becausse the log of 0 in any base is -Inf, and the patch function will not work with non-finite values.
.
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!