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.
답변 (2개)
Azzi Abdelmalek
2012년 10월 13일
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
Ravindra Pokharia
2012년 10월 14일
편집: Ravindra Pokharia
2012년 10월 14일
Azzi Abdelmalek
2012년 10월 14일
편집: Azzi Abdelmalek
2012년 10월 14일
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
2012년 10월 14일
Walter Roberson
2012년 10월 14일
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
Ravindra Pokharia
2012년 10월 14일
Walter Roberson
2012년 10월 14일
편집: Walter Roberson
2012년 10월 14일
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.
카테고리
도움말 센터 및 File Exchange에서 Surfaces and Volumes에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!