Question: Plotting may be generated from from variable arrays or using MATLAB function files that contain the function math. Our examples are written using data arrays

Plotting may be generated from from variable arrays or using MATLAB function files that contain the function math. Our examples are written using data arrays and assume that the student knows how to fill a data array. Often the independent variable (x axis) is linear and may be created using a very simple construct:
x =[ starting value : step size : end value];
This construct will load numbers into the variable named x starting with the starting value, spaced by the step size, and ending with the end value.
Function value arrays (y, y1, y2, etc.) can be generated using the function math, but it is important to remember that there are rules for multiplying and dividing matrices apply. We cannot use MATLAB syntax y = x*x to multiply two arrays as defined above. Instead we must use y = x.*x; The same is true for division if y = y.^2, then z can something like x./y provided that y can never be zero. The .*.^ and ./ with the dot are called "element by element multiple, exponentiation and division. When working with one dimensional arrays this is really want we want: the first element of one array to multiply the first element of the second array etc. to the end.
Use the document below to create a single plot with two plot lines. Create your own x values and functions y1 and y2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!