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 y y 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 xx to multiply two arrays as defined above. Instead we must use y xx; The same is true for division if y y then z can something like xy 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 y and y
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
