Plotting y vs x in an inseparable form

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.

Antworten (2)

Azzi Abdelmalek
Azzi Abdelmalek am 13 Okt. 2012

0 Stimmen

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 Kommentare

Ravindra Pokharia
Ravindra Pokharia am 14 Okt. 2012
Bearbeitet: Ravindra Pokharia am 14 Okt. 2012
Azzi, thank u 4 replying to my query, however i am not still getting the graph that i require. Actually, it's a plot of Vout vs Vin of a MOS inverter with saturated MOS load when the driver is in triode region. the equation for the triode region is: (1+B)*u^2 - 2*(1+B*w)*u + 1 = 0 where, B=5,50,100(for different cases); w= (Vin-1.5)/3.5 ; u= Vout/3.5
Azzi Abdelmalek
Azzi Abdelmalek am 14 Okt. 2012
Bearbeitet: Azzi Abdelmalek am 14 Okt. 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)
Azzi, vin has to be varied from 1.5 to 5 so w will be varied from 0 to 1. I need a plot between vout and vin so plot(vin,vout) will be there. Ok the whole plot:
1. if vin<1.5 vout=3.5
2. if vin>=1.5 then
a. if vout>= vin-1.5 then vout= 5-(1- (B)^(1/2))*1.5 - (B)^(1/2)vin
b. if vout<= vin-1.5 then the above equation is valid i.e
(1+B)*u^2 - 2*(1+B*w)*u + 1 = 0 where, B=5,50,100(for
different cases); w= (Vin-1.5)/3.5 ; u= Vout/3.5
For both a and b , as vin increases vout must decrease.
look plot on pg 1149. Kd/Kl is B

Melden Sie sich an, um zu kommentieren.

Walter Roberson
Walter Roberson am 14 Okt. 2012

0 Stimmen

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 Kommentare

Ravindra Pokharia
Ravindra Pokharia am 14 Okt. 2012
Walter, thank u for the help. i tried to plot it this way earlier but got the error ???error using====>mpower
matrix must be square
maybe because matlab works with matrices and for vin we have created a matrix but for vout we r not. i don't know if itz correct!
Walter Roberson
Walter Roberson am 14 Okt. 2012
Bearbeitet: Walter Roberson am 14 Okt. 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.

Melden Sie sich an, um zu kommentieren.

Produkte

Gefragt:

am 13 Okt. 2012

Community Treasure Hunt

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

Start Hunting!

Translated by