ex10_7.m

来自「Advanced Engineering Mathematics using M」· M 代码 · 共 20 行

M
20
字号
% EX10_7.M Plot Taylor series approximation and%  function f(x,y)= sqrt(1+x^2+y^2); Input y value.clear              % Clear variablesclf                %  and figuresx=[-2:0.2:2];y=input('Input y value= ')z1=x.^2+y.^2;      % Quadratic termsZ=sqrt(1+z1);      % Functionztay=1+z1/2;       % Taylor approximation% Plot the two graphs in one figureplot(x,ztay,'-')   % Dotted lineshold               % Plot on same axisplot(x,Z,'--')legend('f(x,y)','Taylor Approx')title(['Approximation of z=sqrt(1+x^2+y^2), ',...' y=',num2str(y)])xlabel('x')ylabel('z')zoom                % Change resolution with mouse

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?