Calculations using Inline Functions
Show older comments
Hello... I'm still a beginner when it comes to using MATLAB and I can't seem to figure this equation out.
My Code:
t = (-100:0.01:100);
g = inline ('(exp(-t).*(cos(2*pi*t))).*(t>=0)','t');
h = inline ('g((2*t)+1) + g(1-t)','t','g');
E = inline('((g(2*t+1) + g(1-t)).^2)','t','g'); % square of the function h(t)
En = quad(E(h,t),-100,100);
En (E,t)
Error:
Error using inlineeval (line 14)
Error in inline expression ==> ((g(2*t+1) + g(1-t)).^2)
Undefined function 'mtimes' for input arguments of type
'inline'.
Error in inline/subsref (line 23)
INLINE_OUT_ = inlineeval(INLINE_INPUTS_,
INLINE_OBJ_.inputExpr, INLINE_OBJ_.expr);
Error in BA2 (line 27)
En = quad(E(h,t),-100,100);
Please and thank you.
Accepted Answer
More Answers (0)
Categories
Find more on Function Creation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!