% % % % Do some function evaluation tricks % % Jon Collis % 24 January 2012 % % Just make sure we don't have extra stuff confusing things clear; % Define some function f=@(x) exp(x); %Some x values x = 1:0.1:10; figure(4); plot(x,f(x)); xlabel('x'); ylabel('exponential'); title('Plot of exp(x)'); % Define some other function f2=@(x,t) cos(x-5*t); %Some t values t = 5:0.1:14; figure(5); plot3(x,t,f2(x,t)); xlabel('space') ylabel('time') zlabel('cos(c-5t)') title('Plane wave propagating in one dimension')