# MATLAB Curve fitting-Custom Equation with 2 boundaries

Started by July 9, 2009
Hi Dear
I am wondering if anybody would know how to fit a set of data (x, y) with a
custom equation.
The equation is:

y=k*{2*(a-b)-(sin(2*a)-sin(2*b))}, where 'a' and 'b' is function of 'x' but
both 'a' and 'b' have separate boundary conditions. In effect, the angle 'a'
and 'b' has a phase difference.
'k' is a constant.

I really appreciate your reply. I would like to know if i could used some
other package.

regards
Faisal
Hi Faisal,

I have done something similar using Mathematica, its very simple, try this
http://reference.wolfram.com/mathematica/ref/FindFit.html

Not sure in Matlab, maybe try fsolve !

Let me know if this helps.

Good luck,
Tilak

On 7/8/09, Faisal, Nadimul H wrote:
> Hi Dear
> I am wondering if anybody would know how to fit a set of data (x, y) with a
> custom equation.
> The equation is:
>
> y=k*{2*(a-b)-(sin(2*a)-sin(2*b))}, where 'a' and 'b' is function of 'x' but
> both 'a' and 'b' have separate boundary conditions. In effect, the angle 'a'
> and 'b' has a phase difference.
> 'k' is a constant.
>
> I really appreciate your reply. I would like to know if i could used some
> other package.
>
> regards
> Faisal
>
Hi
I am trying to take log of an image data, it comes up with an error like

Function 'subsindex' is not defined for values of class 'struct'

I am not sure what actually this error is.

data2=log(data)

thanks
hek
Hi
I am trying to take log of an image data, it comes up with an error like

Function 'subsindex' is not defined for values of class 'struct'

I am not sure what actually this error is.

data2=log(data)

thanks
hek
Hi Faisal,

I have done something similar using Mathematica, its very simple, try this
http://reference.wolfram.com/mathematica/ref/FindFit.html

Not sure in Matlab, maybe try fsolve !

Let me know if this helps.

Good luck,
Tilak

On 7/8/09, Faisal, Nadimul H wrote:
> Hi Dear
> I am wondering if anybody would know how to fit a set of data (x, y) with a
> custom equation.
> The equation is:
>
> y=k*{2*(a-b)-(sin(2*a)-sin(2*b))}, where 'a' and 'b' is function of 'x' but
> both 'a' and 'b' have separate boundary conditions. In effect, the angle 'a'
> and 'b' has a phase difference.
> 'k' is a constant.
>
> I really appreciate your reply. I would like to know if i could used some
> other package.
>
> regards
> Faisal
>
Hi Dear
I am wondering if anybody would know how to fit a set of data (x, y) with a
custom equation.
The equation is:

y=k*{2*(a-b)-(sin(2*a)-sin(2*b))}, where 'a' and 'b' is function of 'x' but
both 'a' and 'b' have separate boundary conditions. In effect, the angle 'a'
and 'b' has a phase difference.
'k' is a constant.

I really appreciate your reply. I would like to know if i could used some
other package.

regards
Faisal