Hi aman,
I understand that you have a set of CSV files named as 1_1.csv, 1_2.csv, and so on. Each CSV file contains temperature data for different locations. The task is to estimate the temperature at a specific point in each CSV file. It is also possible that the specific point may not be present in a CSV file, in that case interpolation will be used to measure the temperature.
Now, the CSV files have been renamed, and the new file names are in the form of 1_1_1.csv, 1_1_2.csv, and so on. Here is the modified code that will work with the updated file names:
XYZq = csvread("DATA.csv");
num1s = 1:21;
num2s = 1:9;
num3s = 1:11;
T_interp = nan(size(XYZq,1), numel(num1s), numel(num2s), numel(num3s)); % 4 dimensions
for num1 = num1s
for num2 = num2s
for num3 = num3s
dataFilename = sprintf("%d_%d_%d.csv", num1, num2, num3);
data = csvread(dataFilename, 9);
T_data = scatteredInterpolant(data(:,1:3), data(:,4));
T_interp(:, num1, num2, num3) = T_data(XYZq);
end
end
end
I hope this helps!