Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

how do i input this in built in funtions

1 vue (au cours des 30 derniers jours)
adriana resendez
adriana resendez le 9 Fév 2015
Clôturé : MATLAB Answer Bot le 20 Août 2021
multiply and count elements

Réponses (2)

Star Strider
Star Strider le 9 Fév 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

Image Analyst
Image Analyst le 9 Fév 2015
If m is your matrix:
theProduct = prod(m(:)); % Multiply all elements together.
theCount = numel(m); % Count the number of elements in the array.

Cette question est clôturée.

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by