Question: Matlab 6. Generate a vector with 30 random integer elements with integer values ranging between 20 and 40. Replace all the elements that are not

Matlab

Matlab 6. Generate a vector with 30 random integer elements with integer

6. Generate a vector with 30 random integer elements with integer values ranging between 20 and 40. Replace all the elements that are not even integers with random integers between 20 and 40. Repeat step b until all the elements in the vector are even integers Your code should keep track of how many times step b was repeated. Display the final vector in the command window as well as a statement that tells how many iterations were required (how many times step b was repeated.) a. b. c. d. e. Sierpioski triangle can be implemented in MATLAB by plotting points iteratively according to one of the following three rules that are selected randomly with equal pproknabiliy Rule 1: xn+,-0.5xn , yn+1-0.5?? Rule 2: xn+10.5xn + 0.25, yn+1-0.5yn + 7. V3 4 Use loops to calculate the x and y vectors, then plot y versus x as individual points (use plot(xx'n'). Start with x1-0 and y1-0. Use a for-loop to run the program 4 times with 10, 100, 1,000 and 10,000 iterations. Use the figure command or subplot to ensure that all 4 plots can be seen after running your code

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!