run the matlab scriptsum single0 term


Run the MATLAB script
sum = single(0); term = single(1);
n=1;
while sum + term > sum
sum = sum+term;
n=n+1;
term = 1/n;
end
n

Explain what you think it is trying to do. What would this code do in exact arithmetic?Describe why the code produces a nite result and (harder) describe the output. What would happen (don't try it!) if you replaced the fi rst line with sum=0; term=1;?

Request for Solution File

Ask an Expert for Answer!!
Applications of MATLAB: run the matlab scriptsum single0 term
Reference No:- TGS0218564

Expected delivery within 24 Hours