Matlab/Numerical Methods

Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /sci/ - Science & Math

You are currently reading a thread in /sci/ - Science & Math

Thread images: 2

Anonymous

Matlab/Numerical Methods 2016-01-26 03:39:48 Post No. 7811091

[Report] Image search: [iqdb] [SauceNao] [Google]

Matlab/Numerical Methods 2016-01-26 03:39:48 Post No. 7811091

[Report] Image search: [iqdb] [SauceNao] [Google]

Any MatLab Geniuses out there. I am completely lost on how to solve this. I think I need to use a while loop. Any help would really be appreciated.

>>

while pival-pi >err?

>>

>>7811091

>matlab geniuses

>approximating via series

toppu kekku

Yeah, you do need to use a while loop.

In informal terms, you're doing this

while |(pi - piVal) / (pi) * 100| > err

add another term to the approximation

increment my location in the series

when that's done you return your last piVal and how many terms you needed

>>

God, yall are better help than my teacher.

>>

>>7811091

It should be something like this:

Difference = 1;

Previous = 0;

Next = 1;

Precision = DESIRED NUMBER OF DECIMAL PLACES OF PI;

while Difference > 0

Current = Previous + (4/Next) - (4/(Next+2));

Difference = floor(Current*(10^Precision)) - floor(Previous*(10^Precision));

end

disp(Current);

>>

>>7811550

Oh, and some part of the while loop where you increment Next by 4 each time it loops.

Can't be bothered checking it in matlab, but it should hopefully work.

Thread images: 2

Thread DB ID: 465771

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.

This is a 4chan archive - all of the shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.

If a post contains personal/copyrighted/illegal content, then use the post's