3 views (last 30 days)

Show older comments

L12 L13 L23

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

how to create a matrix

Veronica Taurino
on 16 Mar 2021

Edited: Veronica Taurino
on 16 Mar 2021

Your question is not clear. If you have those 3 arrays:

L12 = [0 0 0 0 1 1 1 1];

L13 = [0 0 1 1 0 0 1 1];

L23 = [0 1 0 1 0 1 0 1];

Matrix = [ L12; L13; L23]

or

Matrix = [ L12; L13; L23 ]'

depending or your needs

Walter Roberson
on 16 Mar 2021

[L23, L13, L12] = ndgrid(0:1);

L12 = L12(:); L13 = L13(:); L23 = L23(:);

table(L12, L13, L23)

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

Start Hunting!