# Solving Kramers- Kronig Relation using MATLAB

1. Aug 6, 2007

### gcmt

I have plotted a string of experiment data to form f''($$\varpi$$)
However, I do now know how to incoperate the f''($$\varpi$$) into KKR. My problem now is that I do not know how to integrate f''($$\varpi$$) /{$$\varpi'^2-\varpi^2$$} using Matlab.

I've tried plotting the area under the curve of eq, f''($$\varpi$$) /{$$\varpi'^2-\varpi^2$$} . But my plotted curve is exactly the same as the curve for f''($$\varpi$$) /{$$\varpi'^2-\varpi^2$$}

2. Aug 7, 2007

3. Aug 7, 2007

### gcmt

I've tried trapz(X,Y). But there is an error saying that "LENGTH(X) must equal the length of the first non-singleton dimension of Y."

May I know what is the problem?
How shall i define the length of X since my X is generated with hundreds of experiment data.

4. Aug 7, 2007

### jpr0

I'm not sure - can you send me the file containing your data? I'll see what I can do from here...

ps: once you've loaded the variables X and Y from the data source, just check that the dimensions of these arrays agree using "whos". They should be the same length.

Last edited: Aug 7, 2007