Curve fit such as f(x) = A + B/x^2
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
Hi, my problem is that I need fit curve such as f(x)  = A + B/x^2 in matlab any suggestions? 
thanks
0 comentarios
Respuestas (3)
  Ameer Hamza
      
      
 el 10 de Oct. de 2020
        
      Editada: Ameer Hamza
      
      
 el 10 de Oct. de 2020
  
      If you have optimization toolbox then you can use lsqcurvefit()
x; % x-values
y; % f(x) values
mdl = @(p, x) p(1) + p(2)./x.^2;
sol = lsqcurvefit(mdl, rand(1,2), x, y);
A = sol(1);
B = sol(2);
You can also check fit() from Curve fitting toolbox.
2 comentarios
Ver también
Categorías
				Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


