0
0
MATLABdata~10 mins

Matrix concatenation in MATLAB - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to concatenate two matrices A and B horizontally.

MATLAB
C = [A [1] B];
Drag options to blanks, or click blank then click option'
A.
B;
C,
D:
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolon instead of comma causes vertical concatenation.
Using dot or colon is invalid syntax here.
2fill in blank
medium

Complete the code to concatenate two matrices A and B vertically.

MATLAB
C = [A [1] B];
Drag options to blanks, or click blank then click option'
A;
B,
C.
D:
Attempts:
3 left
💡 Hint
Common Mistakes
Using comma instead of semicolon causes horizontal concatenation.
Using dot or colon is invalid syntax here.
3fill in blank
hard

Fix the error in the code to concatenate matrices A and B horizontally.

MATLAB
C = [A [1] B];
Drag options to blanks, or click blank then click option'
A:
B;
C.
D,
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolon causes vertical concatenation, not horizontal.
Using dot or colon is invalid syntax.
4fill in blank
hard

Fill both blanks to create a 2x2 block matrix from A and B horizontally and vertically.

MATLAB
C = [[A [1] B]; [A [2] B]];
Drag options to blanks, or click blank then click option'
A,
B;
C.
D:
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolon inside rows causes vertical concatenation, breaking the block structure.
Using dot or colon is invalid syntax.
5fill in blank
hard

Complete the code to create a block matrix with A and B arranged in a 2x2 grid.

MATLAB
C = [[A , B]; [B , A]]; sizeC = size(C, [1]);
Drag options to blanks, or click blank then click option'
A,
B;
C1
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using semicolon inside rows breaks horizontal concatenation.
Using 1 instead of 2 in size returns number of rows, not columns.