Question
Create a mandelbrot set program in MATLAB , should be a single function that implements the following steps. You should implement and test each step
Create a mandelbrot set program in MATLAB , should be a single function that implements the following steps.
You should implement and test each step before going to the next step. Please read the Helpful Hints section below BEFORE you begin programming.
1. Clear the command window.
2.Display a useful introduction to the program's user in the command window.
3.
Get the limits on the x (real) axis and the y (imaginary) axis that define a rectangular region in the complex plane.
a. prompt for and get from the user the left limit of the x axis; the input can be any floating point number and does not need to be validated b. prompt for and get from the user the right limit of the x axis; the input must be validated to be greater then the left limit c. prompt for and get from the user the bottom limit of the y axis; the input can be any floating point number and does not need to be validated d. prompt for and get from the user the top limit of the y axis; the input must be validated to be greater then the bottom limit
4.Create an 2D array containing all ones. The size of the array should be defined by "constants" at the top of your program.
5.For every row and column position in the 2D array, do the following:
a. Calculate (or set) a variable c equal to the complex number associated with this row/column position in the 2D array b. Initialize a variable z to 0 c. Repeatedly calculate the formula z = z2 + c until the magnitude of z gets greater than or equal to 2.0 or you have done the equation at least 64 times. In addition, count the number of times the equation is calculated. d. Set the value of your 2D array at this row/column position to the number of times you executed the equation.
6.Display the image represented by your 2D array using the image() command.
7.Display text to the command window that contains the following information. Make sure your output is nicely formatted. Only values that never exceeded 2.0 in your calculation loop after 64 tried are considered part of the Mandelbrot Set. All other points are definitely not a part of the set.
For this image: There are ??? points probably in the Mandelbrot Set There are ??? points definitely NOT in the Mandelbrot Set
8.If all of the points represented in the image are part of the Mandelbrot set, display the message:
All of the points are probably in the Mandelbrot set - not very interesting!
9.If all of the points represented in the image generated a value greater than 2.0 on their first calculation, display the message:
Your image is totally blue -- not very interesting!. Please select a region of the complex plane closer to the origin.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started