The following is part of an experiment about the speed of sound in different depths of a liquid, I'm trying to solve it in Matlab.(adsbygoogle = window.adsbygoogle || []).push({});

http://img546.imageshack.us/img546/5952/20120408201206.jpg [Broken]

Here is my attempt:

But I keep getting the following error:Code (Text):clc

clf

N=13;

d=1900:-100:700;

t=[2.62 2.37 2.35 2.25 2.09 1.86 1.78 1.64 1.53 1.35 1.18 1.09 0.89];

plot(d,t, '-m*');

p = polyfit(d,t,1);

hold on

plot(d,polyval(p,d))

tf=polyval(p,d);

for i = 1:1:N

sigmat=sqrt(sum(((t-tf).^2)/(N-2)));

end

[p,sp]=regress(d,t,sigmat,1)

What is wrong with my code, and how can I fix it? Any help is greatly appreciated.Code (Text):Error using regress

Too many input arguments.

Error in Q2 (line 24)

[p,sp]=regress(d,t,sigmat,1)

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Regress in Matlab

Loading...

Similar Threads - Regress Matlab | Date |
---|---|

Software for finding a best-fit ellipse (please help)? | Apr 7, 2015 |

Geographically Weighted Regression in MATLAB | Aug 10, 2014 |

Multiple Regression in Excel for Mac | Jun 24, 2014 |

Sigma Plot, Non-linear regression, fitting a line to a set of points | Jan 29, 2013 |

Matlab,linear regression | Nov 20, 2009 |

**Physics Forums - The Fusion of Science and Community**