How to interpolate 10 csv files with different x,y,z into a common grid and average them in MATLAB?
Hello,
I have 12 CSV files from a chromatic confocal sensor.
Each file has three columns: x, y, z.
The problem:
Each measurement has different x,y and z positions, since it is spirally scanning. I found x is more deviating than y and z.
I want to create a virtual reference surface by averaging these 12 measurements.
To do that, I need to interpolate each dataset onto the same (x,y) grid before averaging.
My questions:
How can I load all 10 CSVs and interpolate them onto a common regular grid in MATLAB?
2. What is the best function for interpolation in this case (griddata, scatteredInterpolant, or something else)?
3. Once all are on the same grid, how do I average the z-values to get one final reference surface and save it as a CSV?
Any example code or workflow would be greatly appreciated.
Thanks in advance!Hello,
I have 12 CSV files from a chromatic confocal sensor.
Each file has three columns: x, y, z.
The problem:
Each measurement has different x,y and z positions, since it is spirally scanning. I found x is more deviating than y and z.
I want to create a virtual reference surface by averaging these 12 measurements.
To do that, I need to interpolate each dataset onto the same (x,y) grid before averaging.
My questions:
How can I load all 10 CSVs and interpolate them onto a common regular grid in MATLAB?
2. What is the best function for interpolation in this case (griddata, scatteredInterpolant, or something else)?
3. Once all are on the same grid, how do I average the z-values to get one final reference surface and save it as a CSV?
Any example code or workflow would be greatly appreciated.
Thanks in advance! Hello,
I have 12 CSV files from a chromatic confocal sensor.
Each file has three columns: x, y, z.
The problem:
Each measurement has different x,y and z positions, since it is spirally scanning. I found x is more deviating than y and z.
I want to create a virtual reference surface by averaging these 12 measurements.
To do that, I need to interpolate each dataset onto the same (x,y) grid before averaging.
My questions:
How can I load all 10 CSVs and interpolate them onto a common regular grid in MATLAB?
2. What is the best function for interpolation in this case (griddata, scatteredInterpolant, or something else)?
3. Once all are on the same grid, how do I average the z-values to get one final reference surface and save it as a CSV?
Any example code or workflow would be greatly appreciated.
Thanks in advance! interpolation, averaging, csv, combine MATLAB Answers — New Questions









