- #1
knowLittle
- 312
- 3
clf;
clear all;
syms x
%t=linspace(0, pi);
%x=t;
f=@(x) exp(-x).*cos(2*x)
h1=ezplot(f,[ 0, pi]); %plots the function f
f(pi./4)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
My output gives me:
f =
@(x)exp(-x).*cos(2*x)
ans =
2.7918e-017
%%%%%%%%%%%%%%%%%
But, the real answer is 0.
I'm clueless. Please, help.
clear all;
syms x
%t=linspace(0, pi);
%x=t;
f=@(x) exp(-x).*cos(2*x)
h1=ezplot(f,[ 0, pi]); %plots the function f
f(pi./4)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
My output gives me:
f =
@(x)exp(-x).*cos(2*x)
ans =
2.7918e-017
%%%%%%%%%%%%%%%%%
But, the real answer is 0.
I'm clueless. Please, help.