Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer all parts to the question (A taste of vectorization) Loops can be written in MATLAB, but they are NOT the most efficient way

Please answer all parts to the question image text in transcribed
(A taste of vectorization) Loops can be written in MATLAB, but they are NOT the most efficient way to get things done. It's better to avoid loops and use the colon notation instead. The following code has a loop that computes values of the cosine function. The index of yy () must start at 1.) Rewrite this computation without using the loop (follow the style in the previous part). yy = []: % leftarrow initialize the yy vector to be empty for k = -40: 40 yy(k + 41) = exp (-(k/10)*(k/20)): end plot(-40: 40, yy) Explain why it is necessary to write yy(k + 41). What happens if you use yy(k) instead? Also, explain the labels on the x-axis. This functional form is called a Gaussian form. Record your explanations on the Verification Sheet

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions