Complete the code to concatenate two matrices A and B horizontally.
C = [A [1] B];In MATLAB, horizontal concatenation uses a comma , or space between matrices.
Complete the code to concatenate two matrices A and B vertically.
C = [A [1] B];Vertical concatenation in MATLAB uses a semicolon ; between matrices inside square brackets.
Fix the error in the code to concatenate matrices A and B horizontally.
C = [A [1] B];Horizontal concatenation requires a comma or space between matrices inside square brackets.
Fill both blanks to create a 2x2 block matrix from A and B horizontally and vertically.
C = [[A [1] B]; [A [2] B]];
Use commas for horizontal concatenation inside each row, and semicolon to separate rows. Here, inside each row, horizontal concatenation uses commas.
Complete the code to create a block matrix with A and B arranged in a 2x2 grid.
C = [[A , B]; [B , A]]; sizeC = size(C, [1]);size returns number of rows, not columns.Use commas for horizontal concatenation inside rows, semicolon to separate rows, and size(C, 2) to get the number of columns.