MATLAB
y=m/(x^2+bx+c)
x= 1:10;
y=[0.593 0.338 0.216 0.15 0.109 0.084 0.066 0.053 0.044 0.037];
use polyfit to draw a graph
find m,b,c
`Hey,
Note: If you have any queries related to the answer please do comment. I would be very happy to resolve all your queries.
clc
clear all
close all
format short
x= 1:10;
y=[0.593 0.338 0.216 0.15 0.109 0.084 0.066 0.053 0.044 0.037];
A=[x(:).^2 x(:) ones(numel(x),1)];
b=1./y(:);
C=A\b;
m=1/C(1)
b=C(2)*m
c=C(3)*m
f=@(x) m./(x.^2+b*x+c);
xx=1:0.01:10;
yy=f(xx);
plot(xx,yy,x,y,'o');
xlabel('x');
ylabel('y');
title('Plot of x vs y');
legend('Fit','Data');
Kindly revert for any queries
Thanks.
Get Answers For Free
Most questions answered within 1 hours.