Using a for loop, how can I multiply diagonal elements of a matrix NxN?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Stefan Munteanu
el 13 de Dic. de 2019
Comentada: Stefan Munteanu
el 13 de Dic. de 2019
I have an exapmle below which gets the product of the fisrt row an N columns. I am new to mathlab.
Using a for loop like below, how can I multiply diagonal elements of a matrix NxN? thank you
NxN
rowelements= 1 ;
product = 1.0 ;
for(column = 1:N)
product = product*B(row1elements,column) ;
end
1 comentario
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Operating on Diagonal Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!