|
|
| File Information |
| Description |
A circle of radius 0.5 is inscribed inside a square with side length 1.
Script picks N points at random inside the square. It then checks to see if the point is inside the circle and then generates a figure in which the points ''in'' and ''out'' are plotted in different colors. Say we have M points inside the circle. Pi is then approximated as follows:
% Pi = 4*M/N.
No loops!!! |
| MATLAB release |
MATLAB 7.11 (2010b)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (2) |
| 09 Mar 2011 |
Sean de
|
|
|
| 10 Mar 2011 |
Anon
|
|
|
| Updates |
| 11 Mar 2011 |
I have changed the title |
|
Contact us at files@mathworks.com