Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

EXAMPLE 3: More Plotting MORE THAN ONE CURVE PER WINDOW Quite frequently you will want to be able to graph more than one equation on

image text in transcribed

EXAMPLE 3: More Plotting MORE THAN ONE CURVE PER WINDOW Quite frequently you will want to be able to graph more than one equation on the same set of axes. To do this, simply include as many pairs of independent and dependent variables you wish to plot in the plot command. Plot the sine function and the cosine function on the same axis for x 0 to x-360 degrees Procedure: 1. Open the m-file where you want to create the plot. 2. Define the independent variable (remember to convert to radians). x=0:0.1:360; zex/180"pi; 3. Define the dependent variables. y=cos(z); wasin(z); 4. Create the plot command. plot (x,y,X,w), title('Sine and Cosine'),xlabel (Degrees').ylabel('Value').grid; 5. Now you have two equations in the same figure window. The plot generated by the above commands can be seen below. One curve is blue and the other is green. Of course they're both in black ink here. The question is...which curve is which? Of course, we know about sine and cosine, but suppose it was not clear? Answer: We need to have a legend or label or some other defining characteristics for each of the curves. Sine and Cosine 0.0 -- 06- 021- -02- 04

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions