Plotting y vs x in an inseparable form
Mostrar comentarios más antiguos
Hello everyone,
I have just started using MATLAB, so don't know much about it. Please help me out with the following:
I want to plot y as a function of x, x varying from 1 to 5 in some desired steps, from the following equation:
A*y^2 + B*(C+x)*y +D=0
how can I plot it, please help.
1 comentario
Ravindra Pokharia
el 13 de Oct. de 2012
Respuestas (2)
Azzi Abdelmalek
el 13 de Oct. de 2012
A=1;B=2;C=3;D=4
x=1:0.1:5;
for k=1:length(x)
v=[A B*(C+x(k)) D]
sol{k}=roots(v)
end
s=cell2mat(sol)
plot(s')
3 comentarios
Ravindra Pokharia
el 14 de Oct. de 2012
Editada: Ravindra Pokharia
el 14 de Oct. de 2012
Azzi Abdelmalek
el 14 de Oct. de 2012
Editada: Azzi Abdelmalek
el 14 de Oct. de 2012
clear vout;
B=5
w=1:0.1:5;
vin=3.5*w+1.5
for k=1:length(x)
v=[1+B -2*(1+B+w(k)) 1]
vout(k,:)=roots(v)*3.5
end
plot(w,vout)
Ravindra Pokharia
el 14 de Oct. de 2012
Walter Roberson
el 14 de Oct. de 2012
There are two branches,
(2*(B*((Vin-3/2)^2*B-91/4+7*Vin))^(1/2)+7+(-3+2*Vin)*B)/(2+2*B)
(-2*(B*((Vin-3/2)^2*B-91/4+7*Vin))^(1/2)+7+(-3+2*Vin)*B)/(2+2*B)
The two branches combine to create real-valued parabola to the right and above Vout = 0, for that entire range of B. For B=50 and B=100 the two branches also combine to create a real-valued parabola to the left and below Vout = 0.
2 comentarios
Ravindra Pokharia
el 14 de Oct. de 2012
Walter Roberson
el 14 de Oct. de 2012
Editada: Walter Roberson
el 14 de Oct. de 2012
Replace the ^ with .^
I was plotting from Vin = 0; if you start from Vin = 1.5 then the left parabola I mentioned would not be present.
Categorías
Más información sobre Surfaces and Volumes en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!