QuestionQuestion

Transcribed TextTranscribed Text

5. Consider the following pair of functions: C1 : [0,1] [0,1], C2:[0,1] [0,1], 92(2)==22 Together, these two functions form the Cantor set IFS. In this problem, you will create MATLAB code to visualize the behaviour of this IFS! To be specific, you should create a MATLAB function named cantor. m that does the following: It should take in as input a value n. Starting from I = 0, it should repeat the following process 72 times: - It should choose one of the maps C1, C2 at random, and apply it to x. - It should then update I to be this new calculated value. At the end, it should use scatter to plot all of these values of x. (To do this in MATLAB, create a second array y of zeroes that's the same length as your vector of x-values, and plot these versus each other.) If successful, your code should generate a picture similar² to the following for 72 = 1000: 0.1 -- as -0.1 0.2 0.4 0.6 0.8 1

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

% Function definitions
c1 = @(x) x/3;
c2 = @(x) (x+2)/3;

n = input('Insert n: ');

% vector of all generated x points
xv = zeros(1,n);
yv = xv;

x = 0;

for i=1:n-1
   % each time,...

By purchasing this solution you'll be able to access the following files:
Solution.m.

$13.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available MATLAB for Mathematics Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats