What does the error code "Error using plot Non-numeric data is not supported in 'Line'" mean?
조회 수: 5 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Walter Roberson
2016년 9월 14일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!