How to use polyfit function - MATLAB & Simulink
uk.mathworks.com › matlabcentral › answersNov 12, 2018 · A better option is likely: x = ismembertol (strain, linspace (0,.27), 0.01); y = ismembertol (stress, linspace (0,.27), 0.01); and: z=polyfit (strain (x),stress (y),4) % code. although the same elements of both vectors would have to be returned, so the elements correspond and the vectors have equal lengths. Sign in to answer this question.
Polynomial curve fitting - MATLAB polyfit
www.mathworks.com › help › matlabUse polyfit with three outputs to fit a 5th-degree polynomial using centering and scaling, which improves the numerical properties of the problem. polyfit centers the data in year at 0 and scales it to have a standard deviation of 1, which avoids an ill-conditioned Vandermonde matrix in the fit calculation.