Hello, I found some feasible options but it's not yet exactly what I need, and help from people that know better than me is needed.
I used the command "inpolygon" in the following way:
for r=1:size(T_interp ,1);
for c=1:size(T_interp ,2);
if inpolygon(xq(r,c),yq(r,c),x_poli,y_poli)==0;
data_grid_3(r,c) = NaN;
else
end
end
end
With x_poly and y_poly being the vertices of my domain.
The question now is, is there a way to extract the boundaries of the domain automatically? I could do it by hand as I did for this trial code, but my domain
* is 3D (I posted a 2D picture for simplicity) and doing it by hand leads to errors
* is noe exactly sharp, and I need to capture the curvatures as well.
I tried with "boundary" in the following way:
k = boundary(x,y);
figure
plot(x(k),y(k))
hold on
plot(x,y,'o','color',[0.5 0.5 0.5])
As you see in the image attached the boundary does not exactly catch my domain.
Does someone have a suggestion?
I really appreciate any help.
Best regards.