Create a program called generatematrices in that program


Problem 1

Write a program called my_plot.m Your program is to provide a plot (x against y) of the following function

x(t)=16sin3(t)

y(t) = A cos(t) - 5 cos(2t) - 2 cos(3t) - cos(4t)

Let t span the range -10 to 10. The parameter A will be user supplied. In other words, as you run the program it should prompt the user for that value (just like the example that we looked at the end of chapter 1). Let line color of your plot be red and of linewidth greater than 2.

Label your x and y axes as 'X' and 'Y'. Let the title of your plot be 'MY PLOT'.

Problem 2

Create a program called "generate_matrices.m". In that program, generate the following matrices by writing one command (i.e., you are not to type the individual elements explicitly). For MI use the colon operator to address the range of elements

(Hint: you can use [[][]] to concatenate arrays/matrices).

For M2 and M3 make use of eye() (built-in function that allows you to create an identify matrix ... do help on it for more if), zeros() and ones().

As we run your program, it ought to display those three matrices in the command window (don't suppress the output of your command lines).

93_Data.jpg

Solution Preview :

Prepared by a verified Expert
Other Engineering: Create a program called generatematrices in that program
Reference No:- TGS02644599

Now Priced at $50 (50% Discount)

Recommended (97%)

Rated (4.9/5)