coefficient of a matrix on matlab
이전 댓글 표시
Hello assuming we have four matrices
A = [1 2; 3 4];
B = [5 6; 7 8];
C = [9 10; November 12];
D = [13 14; 15 16];
and we want to obtain a new matrix M
M = [[1 5 9 13] [2 6 10, 14]; [3 7 10, 14] [4 8 12 16]]
such as: each field (matrix image) iwritten as [a b c d]
That means :
M (i, j) = printf ("["% d% d% d% d ']', A (i, j), B (i, j), C (i, j), D (i, j ))
I know it is a false writing in matlab but is there such a focntion on matlab with what I write M (i, j) = printf or disp
댓글 수: 5
Walter Roberson
2016년 6월 1일
편집: Walter Roberson
2016년 6월 1일
Are you looking for a text result? Are you looking for a 3D numeric result?
John D'Errico
2016년 6월 1일
This is not a legal matrix in MATLAB:
C = [9 10; November 12];
Unless November is a scalar numeric variable.
AMAL targhi
2016년 6월 1일
AMAL targhi
2016년 6월 1일
AMAL targhi
2016년 6월 1일
채택된 답변
추가 답변 (1개)
Steven Lord
2016년 6월 1일
A = [1 2; 3 4];
B = [5 6; 7 8];
C = [A(:) B(:)]
Note that MATLAB is column-major, so the first column of C is not [1; 2; 3; 4] but [1; 3; 2; 4]. If you want the former, transpose A before constructing C.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!