4. For this problem, there is no separate function m-file. Generate a vector hav
ID: 3759032 • Letter: 4
Question
4. For this problem, there is no separate function m-file. Generate a vector having linearly spaced values between 0 and 2. There should be at least li values in this vector. Create an anonymous function (a function with no name) that evaluates e^-x^2 This anonymous function must be 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')
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.