MATLAB: Can someone help me with this assignment

help_me

i'm using MatLab grader

Best Answer

fa=@(x) (2.*x.^3+3.*x.^2-6.*x+19)./(7.*x.^3-20.*x-5); % define the function for part (a)-REMEMBER to use element-by-element operations (.* ./ .^)
x=[-10 -100 -1000 -10000 -100000 -1000000 -10000000]; % define the vector x
ya=fa(x) % calculate f(x) (No semicolon to see output)
syms x; % DO NOT CHANGE CODE ON THIS LINE
aLimit=limit((2.*x.^3+3.*x.^2-6.*x+19)./(7.*x.^3-20.*x-5),x,-inf ) % No semicolon
% Repeat the above process for part (b)
fb=@(x) sqrt(4.*x.^2+7.*x+1)-2.*x;
x=[10 100 1000 10000 100000 1000000 10000000];
yb=fb(x)
syms x;
bLimit=limit( sqrt(4.*x.^2+7.*x+1)-2.*x,x,inf)
command window:
>> COMMUNITY
ya =
0.2382 0.2814 0.2853 0.2857 0.2857 0.2857 0.2857
aLimit =
2/7
yb =
1.7025 1.7449 1.7495 1.7499 1.7500 1.7500 1.7500
bLimit =
7/4
>>