Question: what's wrong0.0? https://www.chegg.com/homework-help/Numerical-Analysis-2nd-edition-chapter-3.3-problem-5CP-solution-9780321783677 function [y1,y2]=expofnegx2(x) x1=-1;xr=1;y1=-3;yt=3; plot([x1 xr],[0 0],'k',[0 0],[y1 yt],'k');grid on; if x n=10; b=cos((1:2:2*n-1)*pi/(2*n)); yb=exp(-(b.^2)); for k=0:9 k=k+1; c1=newtdd(b,yb,k); x=x1:.01:xr; y=nest(k-1,c1,p,b); hold all
what's wrong0.0?
https://www.chegg.com/homework-help/Numerical-Analysis-2nd-edition-chapter-3.3-problem-5CP-solution-9780321783677
![what's wrong0.0? https://www.chegg.com/homework-help/Numerical-Analysis-2nd-edition-chapter-3.3-problem-5CP-solution-9780321783677 function [y1,y2]=expofnegx2(x) x1=-1;xr=1;y1=-3;yt=3; plot([x1 xr],[0 0],'k',[0 0],[y1 yt],'k');grid on;](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f467d6b6385_39866f467d62593b.jpg)
function [y1,y2]=expofnegx2(x) x1=-1;xr=1;y1=-3;yt=3; plot([x1 xr],[0 0],'k',[0 0],[y1 yt],'k');grid on; if x
n=10; b=cos((1:2:2*n-1)*pi/(2*n)); yb=exp(-(b.^2)); for k=0:9 k=k+1; c1=newtdd(b,yb,k); x=x1:.01:xr; y=nest(k-1,c1,p,b); hold all plot(b,yb,'o',x,y,[x1 xr],[0,0],'k',[0 0],[y1 yt],'k'); axis([x1 xr y1 yt]);grid on; end y2=nest(n-1,c1,p,b); end
function c=newtdd(x,y,n) for j=1:n a(j,1)=y(j); end for i=2:n for j=1:n+1-i a(j,i)=(a(j+1,i-1)-a(j,i-1))/(x(j+i-1))/(x(j+i-1)-x(j)); end end for i=1:n c(i)=a(1,i); end end
function y=nest(d,c,x,b ) if nargin
Editor-E:\Program Files\MATLABR2017alexpotnegx2.m nestm newtdd.m expofnegx2.m X+ k-k+1 c-newtdd(xpoint,ypoint,k); x-x1:.01:xr; y=nes t (k-1,c,x,xpoint); plot(xpoint,ypoint, o'x,y, [xl xr, [0,0], 'k', [0 0], [yl yt], 'k); axisx xr yl yt]);grid on; 12 15 en 17 -yl-nes t(k-1,c,p, xpoint); 18 20 b-cos(1:2:2*n1)*pi (2*n)); yb-exp -(b. 2)); for k-0:9 24 25 26 27 k-k+1 cl-newtdd(b,yb,k); x-x:.01:xr y=nes t (k-1,cl,p,b); hold all plot(b,yb, o',x,y, [x1 xr], [0,0], k', [0 0], [yl yt], 'k ); axis([xxr yl yt]);grid on; end y2=nes t (n-1,c1,p,b); en 1- Command Window yl,y21-expofnegx20-1) Error using matla Value must be a 1x2 vector of numeric type in which the second element is larger than the first and may be Inf Error in ais LocSetLimits (line 272) set (ax,.. Erro in axis (line 101) LocSetLimits(ax(j),cur_arg, names); Error in expofnegx2 (line 29) axis [xl xr yl yt]):grid on
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
