MATLAB: Polyfitting warning

polyfit warning

hey guys,
when I am using the polyfit function i get the following error printing in the command window:
"Warning: Polynomial is badly conditioned. Add points with distinct X values, reduce the degree of the polynomial, or try centering and scaling as described in HELP POLYFIT. "
I was wondering if there is a way to suppress the printing of this warning in the command window. I know what I am trying to do is correct for this situation. but I just wish it would stop printing it.

Best Answer

I'll take you at your word that you know what you are doing.
ws = warning('off','all'); % Turn off warning
P = polyfit(x,y,N);
warning(ws) % Turn it back on.