Numerical result for symbolic expression could not be obtained
조회 수: 3 (최근 30일)
이전 댓글 표시
syms z T t s;
cz = (1-exp(-10*T)*z^(-1))/((2-exp(-10*T)*z^(-1))*(1-z^(-1)))
cs = subs(cz, z,exp(s*T))
ct = ilaplace(subs(cs,T,0.07),s,t)
y = eval(subs(ct,t,0.1))
stem(0.1,eval(y))
错误使用 stem
Unable to convert expression containing remaining symbolic function calls into double array. Argument must be expression that evaluates to number.
댓글 수: 0
답변 (1개)
Yash
2023년 11월 21일
Hello,
I understad that you are facing issues while using the "stem" function in MATLAB.
The "stem" function specifically works with numeric arguments, such as doubles, vectors, or matrices within certain restrictions, but it does not support symbolic expressions. You can find detailed information about the "stem" function in the MATLAB documentation available at the following link:
In your code, the error is likely caused by providing a symbolic expression as an argument to the "stem" function. The issue arises from the fact that the inverse Laplace of the expression "subs(cs,T,0.07)" in your code does not exist.
If "ilaplace" cannot compute the inverse transform, then it returns an unevaluated call to "ilaplace". For example:
syms F(s) t
F(s) = exp(s);
f(t) = ilaplace(F,s,t)
% Return the original expression using "laplace".
F(s) = laplace(f,t,s)
As the inverse laplace doesn't exist, "y" remains as a symbolic expression in the form of "ilaplace", and the "stem" function can not plot the points.
I hope this explanation helps to clarify the issue you are encountering.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!