Using two models on a function and plot it.
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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;
0 comentarios
Respuestas (1)
Star Strider
el 13 de Feb. de 2017
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.
0 comentarios
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!