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

1 次查看(过去 30 天)
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

采纳的回答

KSSV
KSSV 2017-10-18
编辑:KSSV 2017-10-18
doc prod
n=3
a = magic(n)
b = prod(a,2)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by