
Filling wave in for loop

arzensekd
I am filling the waves (for which I don't know in advance the name of wave) in for loops. Because I am the beginner in Igor programming I have problems. The problem is that I have two for loops where in first for loop I create waves and then filling them with values in the second one. Here is the code:
Function FinalDataSet() Make/O/T ionic = {"15","30","50","75","100","175"} Make/O/N=(8) pH =p+3 Variable i, j For (i=0; i<6;i+=1) Make/O/N=(8) $("KD_I" + ionic[i]) Wave tmpKDI= $("KD_I" + ionic[i]) Print tmpKDI For (j=0;j<8;j+=1) Wave wInputDLS = $("coef_"+"pH" + num2str(pH[j]) + "I" + ionic[i]+"_DLS_clean") Print wInputDLS[1] tmpKDI[j]=wInputDLS[1] endfor endfor End
When I print the reference waves in the code above I get strange values in the resulting wave assigned in tmpKDI.
Any help is appreciated!
Thanks,
Dejan
I don't see any obvious errors in the function.
Here is a reworked version of your function. The comments explain the changes I made or contain observations I made.
If my comments and suggestions don't help, I recommend that you try the Igor debugger. Execute this for help:
January 31, 2012 at 10:18 pm - Permalink
Thanks, it works. It seems that I messed something with temporarely strings.
Sorry for sending code without comments.
Dejan
February 1, 2012 at 02:35 am - Permalink