
`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
clc%clears the screen
clear all %clears the history
format long
%M=rand(100,2)*10;
M=load('CompressionVersusHeight.txt');
x=M(:,1);
y=M(:,2);
C=[sqrt(x)];
b=y;
A=C\b;
s=sprintf('Data with x=A*sqrt(h) curve fit\nA=%.4f',A);
xx=linspace(min(x),max(x),100);
plot(x,y,'*g',xx,A*sqrt(xx));
title(s);
legend('Data','Fit');
xlabel('height (m)');
ylabel('Compression (m)');
Kindly revert for any queries
Thanks.
can someone please help wtih this curve fitting in mathlab 2. Curve Fitting Some tests are run with a ball of a fixed mass dropped from a known height onto a spring that is compressed a measured...