Skip to main content
edited title
Link
user64494
  • 29.1k
  • 4
  • 29
  • 56

How to join two matrix with different dimensions?

added 232 characters in body
Source Link

I have two matrices with different dimensions I want to join them together in one matrix. for example, I have two lists of diseases associated with their symptoms in both matrix, what I want is to join these two lists or matrix in one matrix without lost the observation in each original matrix.

thank you for any insight

I have two matrices with different dimensions I want to join them together in one matrix.

I have two matrices with different dimensions I want to join them together in one matrix. for example, I have two lists of diseases associated with their symptoms in both matrix, what I want is to join these two lists or matrix in one matrix without lost the observation in each original matrix.

thank you for any insight

added 97 characters in body
Source Link
Carl Lange
  • 13.2k
  • 1
  • 38
  • 70

how How to join two matrix with different dimensions

guys plz help ... I have two matrices with different dimensions I want to join them together in one matrix.

{{"Dis", "S1", "S2", "S3", "S4", "S5", "S6","S7", "S8", "S9", "S10", "S11", "S12"},{"D1", 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0},{"D2", 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1},{"D3", 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0},{"D4", 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0},{"D5", 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0},{"D6", 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1},{"D7", 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0},{"D8", 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0},{"D9", 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1},{"D10", 0, 0, 1, 0, 0, 1, 1, 0, 0, 0},{"D6", 0, 1, 0, 0, 1, 0, 1, 0, 0, 1},{"D11", 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1},{"D12", 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0}, {"D13", 1, 0, 1, 4, 0, 0, 1, 0, 0, 1, 0, 0},{"D14", 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1}, {"D15", 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0},{"D16", 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},{"D17", 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1}}

{{"Dis", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S10", 
  "S11", "S12"}, {"D1", 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0}, {"D2", 1,
   0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1}, {"D3", 0, 0, 1, 1, 0, 1, 0, 0, 0,
   0, 0, 0}, {"D4", 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0}, {"D5", 1, 1, 
  1, 0, 1, 1, 0, 0, 0, 0, 0, 0}, {"D6", 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 
  0, 1}, {"D7", 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, {"D8", 1, 1, 1, 
  1, 1, 0, 1, 0, 1, 1, 0, 0}, {"D9", 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 
  1}, {"D10", 0, 0, 1, 0, 0, 1, 1, 0, 0, 0}, {"D6", 0, 1, 0, 0, 1, 0, 
  1, 0, 0, 1}, {"D11", 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1}, {"D12", 0,
   0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0}, {"D13", 1, 0, 1, 4, 0, 0, 1, 0, 
  0, 1, 0, 0}, {"D14", 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1}, {"D15", 0,
   0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0}, {"D16", 0, 0, 0, 0, 1, 0, 0, 0, 
  1, 0, 0, 0}, {"D17", 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1}}

how to join two matrix with different dimensions

guys plz help ... I have two matrices with different dimensions I want to join them together in one matrix.

{{"Dis", "S1", "S2", "S3", "S4", "S5", "S6","S7", "S8", "S9", "S10", "S11", "S12"},{"D1", 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0},{"D2", 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1},{"D3", 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0},{"D4", 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0},{"D5", 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0},{"D6", 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1},{"D7", 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0},{"D8", 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0},{"D9", 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1},{"D10", 0, 0, 1, 0, 0, 1, 1, 0, 0, 0},{"D6", 0, 1, 0, 0, 1, 0, 1, 0, 0, 1},{"D11", 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1},{"D12", 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0}, {"D13", 1, 0, 1, 4, 0, 0, 1, 0, 0, 1, 0, 0},{"D14", 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1}, {"D15", 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0},{"D16", 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},{"D17", 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1}}

How to join two matrix with different dimensions

I have two matrices with different dimensions I want to join them together in one matrix.

{{"Dis", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S10", 
  "S11", "S12"}, {"D1", 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0}, {"D2", 1,
   0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1}, {"D3", 0, 0, 1, 1, 0, 1, 0, 0, 0,
   0, 0, 0}, {"D4", 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0}, {"D5", 1, 1, 
  1, 0, 1, 1, 0, 0, 0, 0, 0, 0}, {"D6", 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 
  0, 1}, {"D7", 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, {"D8", 1, 1, 1, 
  1, 1, 0, 1, 0, 1, 1, 0, 0}, {"D9", 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 
  1}, {"D10", 0, 0, 1, 0, 0, 1, 1, 0, 0, 0}, {"D6", 0, 1, 0, 0, 1, 0, 
  1, 0, 0, 1}, {"D11", 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1}, {"D12", 0,
   0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0}, {"D13", 1, 0, 1, 4, 0, 0, 1, 0, 
  0, 1, 0, 0}, {"D14", 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1}, {"D15", 0,
   0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0}, {"D16", 0, 0, 0, 0, 1, 0, 0, 0, 
  1, 0, 0, 0}, {"D17", 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1}}
Source Link
Loading