Problem with eval and symbolic inequation

조회 수: 2 (최근 30일)
Anna Silva Ferreira
Anna Silva Ferreira 2016년 9월 16일
답변: Mischa Kim 2016년 9월 16일
I am trying to calcendulate the equation below in the manner and I can not.
syms t
syms joelho(t)
joelho(t) = ((0.15*sin(5*pi*t - pi/2) + 0.15)*heaviside(t)*(t<0.4) + (0.53625*sin(10*pi*t/3 + pi/6) + 0.53625)*heaviside(t - 0.4))*180/pi;
t = 0;
s = eval(t);
The following error appears:
Undefined function 'eval' for input arguments of type 'double'.
Error in teste4 (line 8)
s = eval(t);
the result is zero.
  댓글 수: 1
Mischa Kim
Mischa Kim 2016년 9월 16일
편집: Mischa Kim 2016년 9월 16일
What exactly are you trying to do? Evaluate joelho(t) at t = 0 ?

댓글을 달려면 로그인하십시오.

답변 (1개)

Mischa Kim
Mischa Kim 2016년 9월 16일
Anna, try
syms t
joelho = ((0.15*sin(5*pi*t - pi/2) + 0.15)*heaviside(-t - 0.4) + ...
(0.53625*sin(10*pi*t/3 + pi/6) + 0.53625)*heaviside(+t - 0.4))*180/pi;
s = subs(joelho,t,0) % evaluate expression at t = 0
ezplot(joelho,[-2,2]) % plot

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by