Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For Matlab Assume you have three points at the corner of an equilateral triangle, P1 = (0,0), P2 = (0.5,2/2), and P3 = (1,0). Now

For Matlab

Assume you have three points at the corner of an equilateral triangle, P1 = (0,0), P2 = (0.5,2/2), and P3 = (1,0). Now you want to generate another set of points pi = (xi, yi) such that p1 = (0,0) and pi+1 is the midpoint between pi and P1 with 33% probability, the midpoint between pi and P2 with 33% probability, and the midpoint between pi and P3 with 33% probability. Write a function with header [ ] = mySierpinski (n) that generates the points pi for i = 1,,n. The function should make a plot of the points using blue dots (i.e., 'b.' as the third argument to the plot command).

Test Cases:

>>mySierpinski(100)

Try your function for n = 10,000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

What is an interface? What keyword is used to define one?

Answered: 1 week ago

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago