Using two models on a function and plot it.

10 ビュー (過去 30 日間)
Magnarok
Magnarok 2017 年 2 月 13 日
回答済み: Star Strider 2017 年 2 月 13 日
Hello.
I want to plot a function of x. Where at one value of x the mathematical model changes. How would I do that?
This is my code and the two models are rLin and rMet. When "Vsn" reaches a value of 0.95 the rMet model is used, before that rLin is used if "Vsn" > 0.
tx = 40 * 10^-10;
ex = 3.45*10^-13;
on = 180;
Vn = 0.25;
WLn = 0.12/1.4;
B = (on * (ex/tx)*WLn);
rLin = @(Vsn) B*(1.2 - Vn - (Vsn/2)).*Vsn;
rMet = @(Vsn) (B/2)*(1.2 - Vn)^2;

回答 (1 件)

Star Strider
Star Strider 2017 年 2 月 13 日
Try this:
VsnFcn = @(Vsn) rLin(Vsn).*(Vsn >0 & Vsn<=0.95) + rMet(Vsn).*(Vsn>0.95);
also note that ‘rMet’ does not actually use ‘Vsn’ in its calculation.

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by