What is the output of the following code? [code]a=[1 2 3]; b=2; a.\b;[/code]

What is the output of the following code?
Code:
a=[1 2 3];
b=2;
a.\b;
A. .5 1 1.5
B. 2 1 .67
C. Error
D. Cannot be determined
 
Answer: b
Explanation: a.\b signifies a divides b so b is divided by the elements of vector a. Hence, option b is correct. The answer would’ve been .5 1 1.5 is it was a./b.
 

Tìm kiếm

Back
Top