I have a set of data that was recorded by Labview.
The data is recorded in sets of two columns :
(Int: Intensity of data and it is recorded in even-numbered columns), (nonZ: non-normalized Z data which is recorded in odd-numbered columns).
This data belongs to a Z-scan NLO measurement so the data Intensity starts with constant and drastically decreases @z=0 and goes to a minimum of Intensity, thus the point z=0 is the focal point. I need to find the minimum value of Intensity and its corresponding index for each column, then using this index (z-point) I have to rearrange the z-values. So the Z-values will be turn from (0, 10, 20, 30...... .. ) to (...-20 -10 0 10 20....) etc.
*** I separated code sections and tried to explain all steps one by one.
Sec#1: Read the data file and extract the values from Intensity and Z- rows.
Sec#2: Each Intensity- nonZ duo belongs to different measurements and in each data set there is one minimum point for Intensity. Due to this point, the z values need to be rearranged. So I tried to find the indexes of these mins.
Sec#3: Another point is that the columns of each measurement are different, which means in each measurement the number of recorded data points may vary. And that results in NaN values inside the matrix nonZ. I tried to get rit of these NaNs.
Sec#4: After sec#3 I have to turn nonZ array into the mxn matrix (the dimensions should be the same with the matrix Intensity). Then I will rearrange the z-values due to the min of Intensity(using the index of Intensity min). I had used a very similar code for a very long time, but now the shape of the input data has changed so I am arranging the code again. I am confused while erasing the NaN values from a matrix. Is not there a way all the NaNs from a mxn matrix once and left the index values empty.
**There may be a way to divide the nonZ array using the first value in each measurement (0.6250). Because the z- values are automatically created by Labview code they all start with 0.6250. I tried to divide all nonZ array using this specific value, but I guess I did sth wrong.
After this point I could not decide what to do, I could not get a usable form for nonZ matrix. I know how to rearrange the z-values due to min of Intensity but my z-values are not usable now.
NOT: I am attaching the data values, I hope you can give some advice.
Thanks for all.
inputFile = 'xxx_data';
data1 = xlsread([ inputFile '.xls' ]);
C = isnan(nonZ);
Z_col = nonZ(~C);