MATLAB: How to clear all fitting settings

curve fittinggraphicsMATLABplot

I'm plotting some data from a 2068 by 5 matrix (spectra.m) using this code:
load 'spectra.mat'
hold on
for i = 2:5
plot(spectra(:,1), spectra(:,i), 'LineWidth', 7)
end
Every time I run the script, it comes up with a plot of the data as expected but each line has linear fit to it (see picture). Though I'm not sure if it's a fit or some other effect…
I've already tried clearing the work-space and restarted Matlab, in case I've inadvertently changed some settings. However, this didn't make any difference…In fact, if I plot some data from other projects, everything works fine so there must be a problem with the way I'm plotting the matrix!
Any help would be very much appreciated 🙂

Best Answer

It is your data. They are not in sequence along the X axis, and so this is how the Y values are plotted.
Something like this:
>> X = [0:0.01:3*pi/2,0]; % the RHS zero is out of sequence!
>> Y = sin(X);
>> plot(X,Y)