MATLAB: How can one create this matrix, part 3

MATLAB

In the previous post, I have learned how to create a matrix of the form
0 0 0
0 0 0.1
0 0 0.2
0 0 0.3
0 0 0.4
0 0 0.5
0 0.1 0.1
0 0.1 0.2
0 0.1 0.3
using
[X, Y, Z] = ndgrid(0:.1:0.5);
[Z(:), Y(:), X(:)]
Now I want to create a matrix of the form that the third column comes from another vector (say) 1:.1:1.5. Please advise.

Best Answer

[X, Y, Z] = ndgrid( 1:.1:1.5., 0:.1:0.5, 0:.1:0.5);
[Z(:), Y(:), X(:)]