Hi, I have an upper traingular matrix andf a lower triangular matrix. Both have the exact same size. I want to combine these matrices along the diagonal to get a single composite matrix. How can I do that. Thanks.
MATLAB: Combining Matrices
combining matrices
Related Solutions
MATLAB versions prior to R2016b:
>> C = bsxfun(@minus,Q,M)C = 9 4 11 5 7 5 6 9 9 9 11 7 11 11 15 7 12 4 5 14 6 6 12 9 8 12 8 12 12 9 10 15 13 8 5 13 6 9 7 11 9 8 3 13 14 7 10 5 8 14 6 10 7 11 5 6 17 9 7 8 6 6 11 5 9 5 10 10 10 9 6 7 6 6 11 9 9 5 9 7 12 11 10 10 9 12 7 4 8 8 9 7 8 10 10 10
MATLAB versions R2016b or later:
>> Q-Mans = 9 4 11 5 7 5 6 9 9 9 11 7 11 11 15 7 12 4 5 14 6 6 12 9 8 12 8 12 12 9 10 15 13 8 5 13 6 9 7 11 9 8 3 13 14 7 10 5 8 14 6 10 7 11 5 6 17 9 7 8 6 6 11 5 9 5 10 10 10 9 6 7 6 6 11 9 9 5 9 7 12 11 10 10 9 12 7 4 8 8 9 7 8 10 10 10
>> X = [1;2;3;4;5;6];>> Y = bsxfun(@plus,X,0:10:40);>> Z = bsxfun(@plus,Y(:),0:20);>> ZZ = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
Related Question
- List of IDs to matrix of indexes
- Circshift Odd Rows by one
- Index out of bounds because numel(v)=1.
- How to find the in-between value from a array to get corresponding value from 360*2 matrix
- Warning: Matrix is singular to working precision.
- Copying matrix values based on another matrix value in MATLAB
- Polyfit with odd powers only
Best Answer