N = 20;
[X, Y, Z] = ndgrid(1:N);
tform = makehgtform('scale', [400/N, 300/cosd(10)/N, 300*tand(10)], 'translate', [-200, 0, 0], 'xrotate', -10*pi/180);
XYZ = [X(:), Y(:), Z(:), zeros(numel(X),1)];
XYZt = XYZ * tform;
Xt = reshape(XYZt(:,1), size(X));
Yt = reshape(XYZt(:,2), size(Y));
Zt = reshape(XYZt(:,3), size(Z));
scatter3(Xt(:), Yt(:), Zt(:))
xlabel('strike')
ylabel('dip')
zlabel('depth')
set(gca, 'zdir', 'reverse')
2 Comments
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/407104-how-can-i-make-grids-on-an-inclined-surface#comment_581846
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/407104-how-can-i-make-grids-on-an-inclined-surface#comment_581846
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/407104-how-can-i-make-grids-on-an-inclined-surface#comment_581849
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/407104-how-can-i-make-grids-on-an-inclined-surface#comment_581849
Sign in to comment.