% Matlab tutorial covered in class % on 01/26 % Go to my.apps.utep.edu to access Matlab. %to plot 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, 1e+4); >>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)),'b--o'); %placing a labeling for each plotted graph >>legend('exp(x)', 'p1(x)', 'p2(x)', 'p3(x)', 'Location', 'NorthWest' ) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Matlab tutorial covered in class % on 01/26 %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 % To exit the format hex, type format short >>15 402e000000000000 % This is different from the hex format we are used to, type unit8(15) %to see the familiar hex format we are used to. >>unit8(15)