Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
how do i input this in built in funtions
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
multiply and count elements
0 Commenti
Risposte (2)
Star Strider
il 9 Feb 2015
I’m not certain what you want, so I’ll venture this:
x=[3,7,2,9,4];
product_x = prod(x)
elements_x = length(x)
elements_x = numel(x)
produces:
product_x =
1512
elements_x =
5
elements_x =
5
0 Commenti
Image Analyst
il 9 Feb 2015
If m is your matrix:
theProduct = prod(m(:)); % Multiply all elements together.
theCount = numel(m); % Count the number of elements in the array.
0 Commenti
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!