Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a problem with the function interpolation. when I use it my points are all very shifted. Do you have an idea of the solution?

data = Import["EQE.txt", "Table", "HeaderLines" -> 3];
eqelambda = Table[{data[[n, 1]], data[[n, 5]]}, {n, Length[data[[All, 1]]]}];

h[x_] := hplanck*c/(x*10^-9)
f[x_] := Log[-Log[1 - x]]

data11 = h /@ eqelambda[[All, 1]];
data12 = f /@ eqelambda[[All, 2]];
data1 = Table[{data11[[n]], data12[[n]]}, {n, Length[data11]}];
intdata1 = Interpolation[data1];
ListPlot[data1]
Plot[intdata1[x], {x, 0, 1.8}]

Data files here:

https://www.dropbox.com/sh/4ztzyv4zjwwlh1y/u1P_ELgBVA

share|improve this question
8  
...and where are data11 and data12? –  J. M. Apr 17 '13 at 12:45
add comment

1 Answer

We can't find your problem since your question lacks your data definition. But perhaps a working example of what I think you're trying to do may be useful:

datal1 = Range@8;
datal2 = Range@8^2;
data1 = Transpose[{datal1, datal2}];
intdata1 = Interpolation[data1];
Show[ListPlot@data1, Plot[intdata1[x], {x, 1, 8}]]

enter image description here

share|improve this answer
    
I wanted to add my graphs to this question but I wasn't able to share it. Here are thoses graph and the origin of my datas. link And that's the begining of my program: data = Import["EQE.txt", "Table", "HeaderLines" -> 3]; eqelambda = Table[{data[[n, 1]], data[[n, 5]]}, {n, Length[data[[All, 1]]]}]; h[x_] := hplanck*c/(x*10^-9) f[x_] := Log[-Log[1 - x]] data11 = h /@ eqelambda[[All, 1]]; data12 = f /@ eqelambda[[All, 2]]; ... –  melec Apr 18 '13 at 8:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.