What is the output of the following code? [code]conv([1;3],[1;3])[/code]

What is the output of the following code?
Code:
conv([1;3],[1;3])
A. A column vector of 1 6 9
B. A row vector of 9 6 1
C. A row vector of 1 6 9
D. A column vector of 9 6 1
 
Answer: a
Explanation:
The vectors are
1 1 Take anyone and place it horizontally land flip it.
3 3
1 3} 1 and then {3 1} 1
3 3
Next, shift the left matrix one step in the right and the overlapping elements are to be multiplied and added. The first operation will result in 1.
Next, invert the left matrix vertically as {3 1
1} 3
and multiply and add the overlapping elements.
Finally, invert the matrix horizontally as 1
3 {3 1}.
Multiply the overlapping element and finally we get 1 6 9 as a column vector.
 

Tìm kiếm

Back
Top