Answered step by step
Verified Expert Solution
Question
1 Approved Answer
% define the range nn = 2 0 ; % define the loop for calculation of error sum 1 = 0 ;sum 2 = 0
define the range nn; define the loop for calculation of error sum;sum; for ii:nn; formula and values sum;sum for jj:ii sumsumjjjjfactorialjj; sumsumjjfactorialjj; end fvaliisum; fvaliisum; formula and true errors etiiabsfvaliiexpexp; etiiabsfvaliiexpexp; end; formula and relative approxilate errors ea; ea; ea; ea; for kk:nn; eakkabsfvalkkfvalkkexp; eakkabsfvalkkfvalkkexp; end Ttablefval',eteafval',etea; filenameC:UsersuserDocumentsMATLABreltruerror.xlsx; writetableTfilename,'sheet','WriteVariableNames',false;
define the range
nn;
define the loop for calculation of error
sum;sum;
for ii:nn;
formula and values
sum;sum
for jj:ii
sumsumjjjjfactorialjj;
sumsumjjfactorialjj;
end
fvaliisum;
fvaliisum;
formula and true errors
etiiabsfvaliiexpexp;
etiiabsfvaliiexpexp;
end;
formula and relative approxilate errors
ea;
ea;
ea;
ea;
for kk:nn;
eakkabsfvalkkfvalkkexp;
eakkabsfvalkkfvalkkexp;
end
Ttablefval',eteafval',etea;
filenameC:UsersuserDocumentsMATLABreltruerror.xlsx;
writetableTfilename,'sheet','WriteVariableNames',false;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started