How can one create this matrix, part 3

1 view (last 30 days)
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.

Accepted Answer

Matt J
Matt J on 26 Jul 2020
[X, Y, Z] = ndgrid( 1:.1:1.5., 0:.1:0.5, 0:.1:0.5);
[Z(:), Y(:), X(:)]

More Answers (0)

Categories

Find more on Sparse Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!