Originally Posted by
ramdrop
Hey:
Iv written this m-file, basically i want it to have a function, annd to plot it on a graph, then run another m-file within it to show the graph with small limits using its derivative, but when I run it, I don't get any results, i just get this:
f =
[]
Heres the m file:
function [ y ] = f( x )
% calculate f(x)=exp(x)
y=exp(x);
plot(x,f(x));
function [ y ] = fd( x )
% calculates fd(x)=exp(x)
y=exp(x);
plot(x,fd(x),'k')
pause
plot(x,(f(x+0.1)-f(x))/0.1,'r')
pause
plot(x,(f(x+0.01)-f(x))/0.01,'g')
pause
plot(x,(f(x+0.001)-f(x))/0.001,'b')
pause
plot(x,(f(x+0.0001)-f(x))/0.0001,'m')
end
end
cheerz