Info

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

I have to find the maximum element in a two dimensional array and replace it with 0.

1 vue (au cours des 30 derniers jours)
Bryce Imbriale
Bryce Imbriale le 28 Sep 2018
Clôturé : MATLAB Answer Bot le 20 Août 2021
I don't even know where to start. I am also given an example: given array=[1 2 4 5; 8 -7 5 3; 12 45 1 6], after applying your scripts, array==[1 2 4 5; 8 -7 5 3; 12 0 1 6].

Réponses (1)

ANKUR KUMAR
ANKUR KUMAR le 28 Sep 2018
A=randi(10,5,6)
A(A==max(A(:)))=0
  1 commentaire
Walter Roberson
Walter Roberson le 28 Sep 2018
A question not answered in the specifications is what to do if there are multiple copies of the maximum.

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by