Question: on matlab please (25pts) Create a script file myplot to plot sin(x),cos(x), and 2sin(x)cos(x) in the same figure window. First using colon operator create a
(25pts) Create a script file myplot to plot sin(x),cos(x), and 2sin(x)cos(x) in the same figure window. First using colon operator create a vector x that stores the range of angles between 0x2. You can use /30 as incremental step. Create vectors y,z and u that store sin(x),cos(x) and 2sin(x)cos(x) respectively. Then use plot () command to plot these on the same figure. Use the command hold on between the plot () commands so that a plot command doesn't overwrite the previous plot. Inside the plot command use 'ro', ' g, and 'bs-' options to have red circle symbols with , line, green triangle symbols with ... line, and blue square symbols with solid lines respectively for the three curves. Use axis command to set x - axis and y - axis limits to 02 and 1.5 to 1.5 respectively. Also use xl abe 1 command to have xaxis label as ' x, radians' and ylabel command to have y - axis label as 'trigonometric relations'. Use legend command with arguments as ' sin ', 'cos', and ' 2 sincos'. Lastly, use the title command to give 'Trigonometric Plots' as the plot title
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
