Error using plot A numeric or double convertible argument is expected
Mostrar comentarios más antiguos
Hello, I have this code, but i can't plot the variable Pw because it says "Error using plot,A numeric or double convertible argument is expected" but 've tried with ezplot, and stems and any of them fix the problem, what i have to do to plot Pw?
t=1e3:100:10e3;
syms p;
%x=-1510:1:1610;
%y=((x.^2)/(41)-1000);
%y1=y*-10;
w1=2e3;
w2=8e3;
A=10;
B=20;
g=parabola1;
%g1=EDFA;
z=100e-6;
%figure(3)
%plot(parabola1)
%fprintf(parabola1);
%axis([1300 1800 0 10e3])
figure(1)
f(t)=A*sin(w1*t)+B*cos(w2*t);
Pi=f(t);
plot(Pi)
figure(2)
%pione=EDFASinglePassGain_Analytical(Pi);
%stem(pione)
Pw=Pi.^(g*z);
plot(Pw)
%figure(4)
%Pw1=Pi.^g1*z;
%plot(Pw1)
Respuestas (2)
YOu need to convert your sym varaible to double to plot. Read about double.
2 comentarios
Carlos Antonio Hernández Guerrero
el 1 de Mzo. de 2019
KSSV
el 1 de Mzo. de 2019
Give the complete code..let me check it.
Walter Roberson
el 1 de Mzo. de 2019
0 votos
Old enough releases cannot ezplot symbolic and need to fplot instead .
6 comentarios
Carlos Antonio Hernández Guerrero
el 4 de Mzo. de 2019
Walter Roberson
el 4 de Mzo. de 2019
Editada: Walter Roberson
el 4 de Mzo. de 2019
With old enough MATLAB, you need to pass at least two arguments to fplot: the expression to be plotted, and the range to plot over. For example,
fplot(Pw, [-1 1])
Carlos Antonio Hernández Guerrero
el 4 de Mzo. de 2019
Walter Roberson
el 4 de Mzo. de 2019
what class() is Pw? What size() is it?
Carlos Antonio Hernández Guerrero
el 4 de Mzo. de 2019
Walter Roberson
el 4 de Mzo. de 2019
At the moment it does not make sense to me that you would get that error message. Can you save Pw into a .mat and attach that?
Categorías
Más información sobre Formula Manipulation and Simplification en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!