computing minimum for each rows

2 vues (au cours des 30 derniers jours)
Tino
Tino le 30 Mai 2019
Commenté : Tino le 30 Mai 2019
Hi
I have a data called D consisting of three column
D =
1 2 4
7 9 0
6 8 9
2 9 0
7 6 5
I want to get the minimun number of each rows
for instance the answer for above D will give
1
0
6
0
5
The code must be able to n number of rows
Thanks in advance
Tino

Réponse acceptée

KALYAN ACHARJYA
KALYAN ACHARJYA le 30 Mai 2019
Modifié(e) : KALYAN ACHARJYA le 30 Mai 2019
mat1=sort(D')
result=mat1(1,:)';
Output
result =
1
0
6
0
5
There is more smart way please check this function also
  1 commentaire
Tino
Tino le 30 Mai 2019
Thanks Kalyan

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Tags

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by