Question

Use MATLAB to find the best a, b, and c coefficients for curve y=a*(sqrt(x)/x)+bx+c to fit...

Use MATLAB to find the best a, b, and c coefficients for curve y=a*(sqrt(x)/x)+bx+c to fit

these data points: (x,y)=[(0.1 2.5) (1.2 1.64) (2.1 1.67) (3.35 1.81) (4.5 1.9)]
Use fprintf to show the a,b,c values you obtained, also plot the points and fitted curve in one plot (use proper labels.)

Homework Answers

Answer #1

the matlab script is as follows:

x=[0.1 1.2 2.1 3.35 4.5];

y=[2.5 1.64 1.67 1.81 1.9];

% defining parameters in 1 variable

%c(1)=a;

%c(2)=b;

%c(3)=c;

% defining the non linear curve

F=@(c,xdata) c(1)*(sqrt(xdata)/xdata)+c(2)*xdata+c(3);

% setting up initial value

c0=[0 1 1];

% solver for curve fitting

[c,resnorm,~,exitflag,output] = lsqcurvefit(F,c0,x,y)

fprintf(' the values of coeeficients a,b,c are %d, %d, %d',c(1),c(2),c(3));

plot(x,y,'ro')

title('Data points')

hold on

for i=1:5

y1(i)=F(c,x(i));

end plot(x,y1)

hold off

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Curve-Fit Function USING MATLAB Using the top-down design approach, develop a MATLAB function A8P2RAlastname.m that reads...
Curve-Fit Function USING MATLAB Using the top-down design approach, develop a MATLAB function A8P2RAlastname.m that reads data from a file and performs regression analysis using polyfit and polyval. The function shall have the following features: The input arguments shall include the file name (string), a vector of integers for the degrees of polynomial fits to be determined, and an optional plot type specifier (‘m’ for multiple plots, ‘s’ for a single plot - default). The data files will be text...
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...
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
Using Matlab to solve the problem below Given X=[-2 -1 0 1 2] Y=[1.5 3.2 4.5...
Using Matlab to solve the problem below Given X=[-2 -1 0 1 2] Y=[1.5 3.2 4.5 3.4 2] a). Plot a scatter plot of the data b). Determine the coefficients of the polynomial ?0 + ?1? + ?2?2 which best fits the data c). Plot this function on the same plot as in part ‘a’. USE MATLAB CODE ONLY! USE MATLAB CODE ONLY! THANK YOU
a.) Find the length of the curve y=ln(x),1 ≤ x ≤ sqrt(3) b.) Using disks or...
a.) Find the length of the curve y=ln(x),1 ≤ x ≤ sqrt(3) b.) Using disks or washers, find the volume of the solid obtained by rotating the region bounded by the curves y^2=x and x=2y about the y-axis c.) Find the volume of the solid that results when the region bounded by x=y^2 and x=y+12 is revolved about the y-axis
1) Consider the curve y = e^cos(x) . (a) Find y' (b) Use your answer to...
1) Consider the curve y = e^cos(x) . (a) Find y' (b) Use your answer to part (a) to find the equation of the tangent line to y = e^cos(x) at x = π/2. 2) 3)Consider the curve y = x + 1/x − 1 . (a) Find y' . (b) Use your answer to part (a) to find the points on the curve y = x + 1/x − 1 where the tangent line is parallel to the line...
Using MatLab 2. Given the parametric equations x = t^3 - 3t, y = t^2-3: (a)...
Using MatLab 2. Given the parametric equations x = t^3 - 3t, y = t^2-3: (a) Find the points where the tangent line is horizontal or vertical (indicate which in a text line) (b) Plot the curve parametrized by these equations to confirm. (c) Note that the curve crosses itself at the origin. Find the equation of both tangent lines. (d) Find the length of the loop in the graph and the area enclosed by the loop. 3. Use what...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT