Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use MATLAB!!!!!please use MATLAB!!!!!please use MATLAB!!!!!please use MATLAB!!!!! please provide a neatly code!!!!! please provide detailed explanation!!! 1 Write a MATLAB script with two

please use MATLAB!!!!!please use MATLAB!!!!!please use MATLAB!!!!!please use MATLAB!!!!!

please provide a neatly code!!!!!

please provide detailed explanation!!!

image text in transcribedimage text in transcribedimage text in transcribed

1 Write a MATLAB script with two functions. - The first function (call it circle) inputs the radius r and angle (circle (r,) ), and outputs the (x,y) coordinates of all the points located at the circle with radius r centered at origin (0,0). function[x,y]=circle(r,theta) - The second function (call it rdcircle) inputs the (x,y) coordinates of all the points located at the circle and outputs m points pj for j=1,2,,m, by choosing p1 as a random point that can be generated using rand- 1+1i( rand-1), and generating other points by pj+1=0.5pj+0.5(zkpj) where k{1,2,,n} is randomly chosen for each j ( n is the number of coordinates that you generated for (x,y)) and z=ex+yi (note that z is a vector and zk is one element). functionp=rdcircle(x,y) - The main script (see below) draws two figures. The first one is just a circle with r=2 centered at origin (filled with some color). The second one shows m=10000 points produced by rdcircle for r=5 as dots. \% function 2: generate m points based on (x,y) on a circle function p= rdcircle (x,y,m) main body (you need to fill in the details) end Hints: 1. you can use randi to generate k. Check the function fill in MATLAB. 2. the second plot uses the real and imaginatary part of p to plot, i.e., plot(real(p),imag(p), ,b.','MarkerSize',1), where p is the vector that stores all the points generated by (1)

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_2

Step: 3

blur-text-image_3

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

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions