You will need to define the problem in more detail for cases where the number of points is not an ideal cube. Hovever, for cases where the number of points is a cube, you can use:
l=linspace(0,1,n+2); x=l(2:n+1); y=x; z=x; [X, Y, Z] = meshgrid(x, y, z);
Then, for each position in the matrices, the coordinates of this point are set by the corresponding elements X, Y and Z. If you want the points listed in one matrix, such that each row is a point, with three columns for the coordinates x, y and z, you can say:
points(:,1) = reshape(X, [], 1); points(:,2) = reshape(Y, [], 1); points(:,3) = reshape(Z, [], 1);
Now you have a list of points n^3 on the grid in the entire unit cube, excluding the borders. Like others, you can probably accidentally delete some points if you want less points. This would be easy to do using randi([0 n^3], a, 1) to generate the indices a deleted points. (Remember to check for duplicates in the matrix returned by randi() , otherwise you cannot remove enough points.)