Question: Use logical indexing to create a function called f that satisfies the following criteria: ( YOU CANNOT USE IF STRUCTURES OR FIND ) For values

Use logical indexing to create a function called f that satisfies the following criteria: (YOU CANNOT USE IF STRUCTURES OR FIND)
For values of x>2,f(x)=x2
For values of x2,f(x)=2x
Store your function at the end of the script m-file and add the rest of the code at the beginning of the file to:
a) Define an array called x from -3 to +5 in steps of 0.5
b) Evaluate the function at each value of x, and call the result y
c) Plot the results on an x-y graph. Annotate appropriately with a title, x-axis label and y-axis label.
 Use logical indexing to create a function called f that satisfies

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!