Non Linear Least Square fitting for large data
Mostrar comentarios más antiguos
Dear all,
I would like to do least square fitting for a data I get from an antenna. The data looks like this Data plot. I tried using this function in Matlab to fit the data and I used a polynomial of 7 degree, but the fitting wasn't appropriate. People suggested that using a polynomial of a higher degree than 7 is not a good idea.
function leastCurvePolynomialFit(x,y, n)
p = polyfit(x, y, n)
poly_line = polyval(p, x);
%Plot data and estimated polynomial
figure
hold all
plot(x,y,'+')
plot(x,poly_line)
xlabel('X')
ylabel('Y')
title('Noisy Data and Fitted Line')
box
end

If anyone can help me solve this problem without toolbox I will really appreciate it because I don't have any extra toolbox from Matlab and I would like to convert the code to C++ eventually.
Many thanks
1 comentario
Star Strider
el 7 de En. de 2015
Do you have a mathematical model of the radiation pattern of your antenna? If so, use the nlinfit and nlpredci (Statistics Toolbox) functions to fit your data to it and estimate the prediction errors. Use the prediction errors to eliminate outliers.
Respuestas (1)
Categorías
Más información sobre Linear Predictive Coding en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!