Polyfit produces NaN values
Show older comments
I'm having an issue using polyfit in an attempt to create a 3rd order line of best fit for some data that I have. I have a 16 x 2 matrix that contains velocity in the first column and power in the second. When I use polyfit(x(:,1),x(:,2),3) I receive NaN NaN NaN NaN. My code looks like
figure(3)
plot(pcurve(:,1),pcurve(:,2),'ro')
BestFit=polyfit(pcurve(:,1),pcurve(:,2),3)
xlabel('\bf Average Velocity (m/s) ');
ylabel('\bf Power ');
titlestr=strcat('\bf\fontsize{14}Velocity Vs. Power ', datafile);
title(titlestr);
Any help or alternate method suggestions are appreciated.
1 Comment
Walter Roberson
on 10 Apr 2016
Does the data contain any NaN or inf ?
Accepted Answer
More Answers (0)
Categories
Find more on Interpolation of 2-D Selections in 3-D Grids 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!