What does the error code "Error using plot Non-numeric data is not supported in 'Line'" mean?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
For some reason I do not know why I am getting the error message below. I have provided my code below as well. Can someone help me figure out what this means and how I can plot the function y?
Error using plot Non-numeric data is not supported in 'Line'
numerator=[10.469*10^3 -5.79264*10^8];
denominator=[1 2.10858*10^4 5.23949*10^7];
[r p k]=residue(numerator,denominator)
syms s
A=5.0218e+04/(s-(-1.8208e+04))+(-3.9749e+04)/(s-(-0.2878e+04))
B=simplify(A)
y=ilaplace(B)
%Plot ilaplace output result
t=0:0.000001:0.002;
plot(t,y)
0 Kommentare
Antworten (1)
Walter Roberson
am 14 Sep. 2016
Your y is a symbolic expression involving the symbolic variable t. When you assign a numeric value to a symbolic variable that was used previously, the expressions that used the symbolic variable do not pick up the new numeric value. You need to subs() the numeric values for the symbolic variable.
tn=0:0.000001:0.002;
yn = double( subs(y, t, tn)) ;
plot(tn, yn)
2 Kommentare
Siehe auch
Kategorien
Mehr zu Calculus finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!