Saturday, July 20, 2013

How to Plot a Solid Line in MATLAB


1. Clear all active variables within the workspace by entering 'clear all' in the Command window.
2. Create data to plot. Input 'x=1:1:50' and 'y=rand(1,50)' into the Command window. These commands will create an array of 50 numbers starting at 1 and ending at 50 for the 'x' data and an array of 50 random numbers for the 'y' data.
3. Plot the data created in step 3 using a solid line by entering 'plot(x, y)' into the Command window. A plot window will appear with each data point connected using a solid line.