What is the output of the following code? A=[1 2 ‘a’;… ‘f’ ‘q’ ‘w’;… ]];

What is the output of the following code?
A=[1 2 ‘a’;…
‘f’ ‘q’ ‘w’;…
]];
A. Syntax Error
B. A 2*3 character matrix
C. The concatenation of 2 vectors, vertically, with size 3
D. Cannot be determined
 
Answer: a
Explanation: There are two ]] at the end. This leads to an error. This is because only one ] was sufficient to produce A as defined in the option concatenation of 2 vectors, vertically, with size 3. But the usage of an extra ] leads to an error the code.
 

Tìm kiếm

Back
Top