I was wondering if it is possible to plot a line of the form y = mx+b in Matlab? I used polyfit to get a 1×2 array that contains the slope and intercept.
Here is what I have so far:
lineFit = polyfit(tauBin, a5array, 1);
plot((lineFit(1)*x + lineFit(2)))
How can I plot this?
There are two way that immediately come to mind. The first is with FPLOT:
The second is to calculate the y values directly in the call to the PLOT command: