(MatLab)
Plot the function A*sin(x) +2(x2) (x = 0 to 5) for5 values of A. Then, create a legend with string functions. To getthe extra credit, an anonymous function and for loop must beused.
Step by Step Instructions:
The goal of the problem will be to create individual strings foreach needed legend entry and store the entries into a cell array,before finally calling legend.
To start, define A = [1,3,5,7,9]
Define your function anonymously (Depending on where you placeit in your code, you’ll need to make your function have 1 or 2local variables (either @(x) or @(a,x)))
Plot the function in a for loop while varying
PayPal Gateway not configured
PayPal Gateway not configured