Exact arithmetic, MATLAB Programming

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;?

Posted Date: 3/22/2013 7:03:16 AM | Location : United States







Related Discussions:- Exact arithmetic, Assignment Help, Ask Question on Exact arithmetic, Get Answer, Expert's Help, Exact arithmetic Discussions

Write discussion on Exact arithmetic
Your posts are moderated
Related Questions
kind in geometric calculity in space AREA. >

i need matlab code on 2 dimensional analysis of temperature distribution in steel using finite element method

a. Develop and submit the simulation described above. b. Provide a screen shot of the outputs of the DispConfig and MCResults functions. c. Notes: • Include the PPConfig f

I want codding in matlab for vogel approximation method . i mean .M file for vogels approximation method.

How to Open Simpower: 1. Open MATLAB 2. In the "Command Window" write ' simulink ' and press Enter or click on the Simulink icon. 3. Simulink Library Browser w

Implement a MatLab function to calculate y.  The function should take two input arguments 1) A vector of parameters In the above example this would be of length 3, the first

how to implement 3 out of 4 visual cryptography?

This assignment is designed to compare performance between Matlab and Excel for performing nonlinear regression analysis of a set of data. There are two data sets in the accompa

Illustrations of calling the function: Here are illustrations of calling the function: >> cylcost(32,73,4.50) ans = 661.5000 >> fprintf('The cost would be $%.2f\n'