MATLAB: Multiply the data of the column with user input value size of the matrix

times

For example, the user input a value for the size of the matrix using the variable n. Then multiply the data of the column for each row of the matrix. The result will then be store on variable b.
n=3
a = magic(n)
a = 8 1 6
3 5 7
4 9 2
8*1*6
3*5*7
4*9*2
b = 48
105
72

Best Answer

doc prod
n=3
a = magic(n)
b = prod(a,2)