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 CenterFile Exchange에서 2-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