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

Risposte (2)

Azzi Abdelmalek
Azzi Abdelmalek il 1 Mag 2016

0 voti

landa is always a complex number.

4 Commenti

Hi . what id do now ?I'm a little confused on this issue .
Do you want to plot only real roots?
Yes : i should see two figure by real number from landa.
Ok,landa contains only complex numbers. What do you want to do with them?

Accedi per commentare.

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 .

Richiesto:

il 1 Mag 2016

Risposto:

il 2 Mag 2016

Community Treasure Hunt

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

Start Hunting!

Translated by