why is my plot not showing anything
이전 댓글 표시
close all;
clc
q=1;
beta=0.28;
teta=30*pi/180;
a=1;
mu=0.72;
k=2;
c=300;
for v0=80:0.5:180;
u0=v0-10;
alfa1=mu*(k-1/2)/(k-3/2);
alfa2=mu*(k-1/2)*(k+1/2)/(2*(k-3/2)^2);
gama1=(1+3*a*u0^2)/(2*c^2);
eta1=1+3*a*v0^2/(2*c^2);
x1=alfa1;
x2=-2*alfa1*u0*cos(teta)+2*alfa1*v0*cos(teta);
x3=-q*beta*cos(teta)^2/eta1-cos(teta)^2/gama1+alfa1*u0^2*cos(teta)^2+alfa1*v0^2*cos(teta)^2+4*alfa1*v0*u0*cos(teta)^2;
x4=2*u0*q*beta*cos(teta)^3/eta1+2*v0*cos(teta)^3/gama1-2*alfa1*v0^2*cos(teta)^3*u0-2*alfa1*v0*u0^2*cos(teta)^3;
x5=-q*beta*cos(teta)^4*u0^2/eta1-v0^2*cos(teta)^4/gama1+alfa1*v0^2*u0^2*cos(teta)^4;
y=[x1,x2,x3,x4,x5];
landa=roots(y);
if isreal(landa(4))
plot(v0,landa(4));
hold on;
end
end
답변 (2개)
Azzi Abdelmalek
2016년 5월 1일
0 개 추천
landa is always a complex number.
댓글 수: 4
Mohammad Alavi
2016년 5월 1일
Azzi Abdelmalek
2016년 5월 1일
Do you want to plot only real roots?
Mohammad Alavi
2016년 5월 2일
Azzi Abdelmalek
2016년 5월 2일
Ok,landa contains only complex numbers. What do you want to do with them?
Walter Roberson
2016년 5월 2일
There are no real roots in the range v0 = 80 to 180. The two real roots are
v0 = -2.9519709800851799940292844879542507513708021691910
v0 = 22.904282241682175870334381209712496165896259534707
The equation is a quartic in which only two of the roots are real. By the range v0 80 to 180, the imaginary components are unquestionably non-zero .
카테고리
도움말 센터 및 File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!