how to create a matrix in matlab?
조회 수: 3 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
Veronica Taurino
2021년 3월 16일
편집: Veronica Taurino
2021년 3월 16일
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
댓글 수: 0
추가 답변 (2개)
Walter Roberson
2021년 3월 16일
[L23, L13, L12] = ndgrid(0:1);
L12 = L12(:); L13 = L13(:); L23 = L23(:);
table(L12, L13, L23)
댓글 수: 15
Walter Roberson
2021년 4월 11일
That code will never do what you want it to do, and it cannot be fixed.
Your source is a paper that is wrong. You need to get corrections from the authors of the paper.
참고 항목
카테고리
Help Center 및 File Exchange에서 Memory Usage에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!