% Matlab tutorial on plotting the exponential function %and its Taylor Polynomial at a =0. %To access the manual of Matlab % type: % help function name %example: help plot >>clear all; >>clf ; >>x=linspace(-1,1); >>plot(x, exp(x)); >>hold on ; %Plotting the linear Taylor polynomial. >>plot(x, 1 + x) ; %Plotting the quadratic Taylor polynomial. >>plot(x, 1 + x + x.*x/2 ) ; %Plotting the cubic Taylor polynomial. >>plot(x, 1 + x + x.*x/2 + x.*x.*x/(factorial(3))); %placing a labeling for each plotted graph >>legend('exp(x)', 'p1(x)', 'p2(x)', 'p3(x)', 'Location', 'NorthWest' ) %Giving a title to the plot >>title('f(x)=exp(x) and Taylor Polynomials of degrees 1,2 and 3.') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Matlab tutorial on number representation % %to generate the hexadecimal format for a given number. %To access the manual of Matlab % type: % help function name %example: help format >>clear all; >>format hex >>7 401c000000000000 >>format short ; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Checking the differentiation using MATLAB Symbolic Toolbox. >>syms x >>f = cos(5*x); %The command differentiates f with respect to x. >>diff(f)