okay so my problem is that I have some data in some arrays z(:,1), u(:,1), s(:,1)(adsbygoogle = window.adsbygoogle || []).push({});

okay I am supposed to use this data with these equations (these are not syntax because I am not sure how to implement this into matlab yet)

H = (omega*(1+z)^3 + (1-omega)*(1+z)^(3*(1+w)))^.5

distLum = (1+z)*integral(1/H,0,z) (that is the integral of 1/H with respect to z from 0 to z)

ufit = 5*log(distLum) + M

basically what I need to do is find the minimum of chi^2

chi^2 = sum of data (u - ufit)^2/s^2)

I hope I explained that sort of. you can see this is quite a problem and not exaclt sure how to use matlab to do this, I was told fminsearch could do the trick. The values I know are z,u,s. My var/para are omega,w,M.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

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

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

# Need some help using fminsearch in matlab

**Physics Forums | Science Articles, Homework Help, Discussion**