Hi, I am trying to generate following code
figure(),hold;
x_points = [-35:0.25:35]
files = dir('rad_cldn2*');
n= zeros(size(x_points,2),length(files));
for i=1:length(files)
eval(['load ' files(i).name]);
data = dlmread (files(i).name);
samplePoints = {(data (:,1)), 1:size(data,2)};
F = griddedInterpolant(samplePoints,data);
queryPoints = {x_points,1:size(data,2)};
dataq = F(queryPoints);
x = dataq(:,1);
y = dataq(:,2);
n (:,i) = y;
plot(x,y,'DisplayName', files(i).name);
end
m = mean (n,2);
plot(x,m,'Linewidth',2,'Displayname','average');
But it's showing me error: "Error using griddedInterpolant.Sample points must be unique."So I assumed there must be duplicate data and that's why it's showing that error! So I have tried to use unique() command and then it's showing error : "Error using griddedInterpolant! Sample points vector corresponding to grid dimension 1 must contain 508 elements." which may be means there is a mismatch between sample points vector and grid dimension! Do anyone have any clue how to solve this error? thank you!