Error when fitting polyfit curve
Show older comments
Trying to plot a polynomial curve onto my time series but keeps coming up with 'Inputs must be floats, namely single or double'
This is the code I've got:
% plot time series
X = Months;
X = categorical({'March','April','May','June','July','August','November'});
M = reordercats(X,{'March','April','May','June','July','August','November'});
Y = AverageDO;
plot(M,Y,'*');
p = polyfit(M,Y,1);
The excel sheet attached is the timeseries data.
Accepted Answer
More Answers (0)
Categories
Find more on Time Series in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!