Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Cells/Functions in Matlab Generate a vector having linearly spaced values betwee

ID: 3764939 • Letter: C

Question

Cells/Functions in Matlab

Generate a vector having linearly spaced values between 0 and 2. There should be at least 11 values in this vector. Create an anonymous function (a function with no name) that evaluates e^-x^2 This anonymous function must he capable of handling an input x that is a vector. Print a table that shows pairs of numbers: x and the above function evaluated at x. This table should have two columns: the first column is for x, and the second column is for function values. For x, there should be at least two decimal places. For the function values, there should be at least three decimal places. The table should be nicely formatted, so that the decimal points line up vertically.

Explanation / Answer

//you can get the required output by running the following code in matlab.

//you can change the x vector values

x = [0.1 0.2 0.3 0.4 0.5 1.6 1.7 0.8 0.9 0.10]

answ=exp( -x.^2 )

horzcat(x',answ')

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote