Numerical result for symbolic expression could not be obtained

조회 수: 3 (최근 30일)
L siky
L siky 2023년 11월 16일
답변: Yash 2023년 11월 21일
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.

답변 (1개)

Yash
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)
f(t) = 
% Return the original expression using "laplace".
F(s) = laplace(f,t,s)
F(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.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!