From: Frederic Moisy on
You can also use the ezyfit toolbox.
http://www.mathworks.com/matlabcentral/fileexchange/10176-ezyfit-2-30

Recognising the error function, you can fit your data with
>> showfit('P(A) = 100*erf((A-theta)/sigma); sigma=1e-4; theta=1e-4');

yielding:
sigma = 0.00040156
theta = 4.8345e-005

Frederic.



"xety89 " <sow.chan(a)warwick.ac.uk> wrote in message <hqouqh$snf$1(a)fred.mathworks.com>...
> Hi,
>
> I have this graph:
>
> x = [0.000235 0.00025 0.0003 0.0004 0.0005 0.0006 0.00075]
> y = [54.9 43.1 62.7 86.3 86.3 90.2 96.1]
>
> plot (x, y)
> xlabel ('Amplitude')
> ylabel ('Correct Detection [%]')
> legend ('Psychometric Function')
>
> and I want to fit it to this equation:
>
> P(A, 'theta') = [1/sqrt(2*pi*sigma²)] * integral e^-[(A-'theta'²)/2*sigma²]
>
> how can i do this?
>
> thank you.