Question: Rewrite the code replacing the while loop with a for loop. % Pi Via Polygons % Input the iteration parameters... clc delta = input('Enter the

Rewrite the code replacing the while loop with a for loop.
Rewrite the code replacing the while loop with a for loop. %

% Pi Via Polygons % Input the iteration parameters... clc delta = input('Enter the error tolerance:'); nMax = input('Enter the iteration bound:'); % The triangle case... n = 3; % Number of Polygon Edges A_n = (n/2)*sin(2*pi); % Inscribed Area B_n = n*tan(pi); % Circumscribed Area ErrorBound = B_n - A_n; % The error bound % Iterate while error too big and n sufficiently small... while (ErrorBound > delta && n

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!