Answered step by step
Verified Expert Solution
Question
1 Approved Answer
matlab Time (sec.) EXAMPLE 2: Problem: Plot the values of cos x for x=0 degrees to x=360 degrees. Program: Figure: The Trig Function Cosine -
matlab
Time (sec.) EXAMPLE 2: Problem: Plot the values of cos x for x=0 degrees to x=360 degrees. Program: Figure: The Trig Function Cosine - Example x=0:0.1:360; z=x*pi/180; y=cos (z); plot (x,y) title('The Trig Function: Cosine') xlabel('X Values in Degrees') ylabel('Cosine of X') grid - ------ - - - - Cosine of X No X - - - LLLLLL - - - - - - -- Note: Matlab calculates trig functions using radians. This example required an intermediate step to convert degrees to radians by multiplying by pi/180. - - - 300 350 100 400 150 200 250 x Values in Degrees Or, you could type: y=cos (x*pi/180); . Example 2 a. Type the commands for Example 2 (p. 4) in an m-file, save the m-file, and execute the m-file in the command window. b. Using the formulas, manually calculate the 5th value that should be found in each of the three vectors: x, z, and y. c. Add commands to the m-file to print only the 5th value from each vector - are you right? d. Publish the Example 2 m-file to a pdf document. Domnle 2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started