Question: MATLAB. Please complete 3.2 and 3.3 3.2 Vectorization Use the vectorization idea to write1 or 2 lines of code that will perform the same task

MATLAB. Please complete 3.2 and 3.3  MATLAB. Please complete 3.2 and 3.3 3.2 Vectorization Use the vectorization
idea to write1 or 2 lines of code that will perform the

3.2 Vectorization Use the vectorization idea to write1 or 2 lines of code that will perform the same task as the inner loop of the following MATLAB script without using a for loop. If you are ambitious, try to replace both loops witlh some vectorized code % make a plot of sum of cosines dt-1/800; xx = rand (1,3). *exp(2i*pi*rand (1,3)); freq 20; sum zeros (1,500); for kx 1:length (XX) %--Random amplitude and phases for kt = 1:500 t = kt*dt; Akabs (XX (kx)) phik angle (XX(kx)) ccsun (kt) = ccsun(kt) tt(kt) = t; Ak*cos (2*pi*freget phk); + + end end plot (tt,ccsum) %-- Plot the sum sinusoid grid on, zoom on, shg Instructor Verification (separate page)

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!