>>
> I have my 3D points as BndX, BndY, BndZ which are 256x1 matrices.
>
> then
>
> xlin = linspace(min(BndX),max(BndX),43);
> ylin = linspace(min(BndY),max(BndY),43);
> [X,Y] = meshgrid(xlin,ylin);
> Z = griddata(BndX,BndY,BndZ,X,Y,'cubic');
>
This is brute force, but I think this may be what you want. I have not
tested any of it, but it should give you an idea of how to get any slice
from your data.
%BndX, BndY, BndZ already defined
Zsurf = @(X,Y) griddata(BndX,BndY,BndZ,X,Y,'cubic');%define surface func
%any slice can be extracted by defining x(t), y(t)
% and evaluating Zsurf(x(t),y(t))
%constant x
x_c=BndX(1)%constant value of x
x1=@(t) x_c*ones(size(t));
y1=@(t) t;
z1=@(t) Zsurf(x1(t),y1(t));
Yplot=linspace(min(BndY),max(BndY),21);
plot(Yplot,z1(Yplot))
%constant y
y_c=BndY(1)%constant value of y
y2=@(t) y_c*ones(size(t));
x2=@(t) t;
z2=@(t) Zsurf(x2(t),y2(t));
Xplot=linspace(min(BndX),max(BndX),21);
plot(Xplot,z2(Xplot))
%along line from (min x,min y) to (max x, max y)
slope=(Yplot(2)Yplot(1))/(Xplot(2)Xplot(1));
y_line==@(x) slope*(xXplot(1))+Yplot(1);
x3=@(t) t;
y3=@(t) y_line(x3(t));
z3=@(t) Zsurf(x3(t),y3(t));
plot(Xplot, z3(Xplot))
%along an ellipse
Xc=(min(BndX)+max(BndX))/2;
Yc=(min(BndY)+max(BndY))/2;
rX=(max(BndX)(min(BndX))/2;
rY=(max(BndY)(min(BndY))/2;
x4=@(t) Xc+rX*cos(2*pi*t);
y4=@(t) Yc+rY*sin(2*pi*t);
z4=@(t) Zsurf(x4(t),y4(t));
Tplot=linspace(0,1,41);
plot(Tplot, z4(Tplot))
