How to find max values in vector for each 10 rows

1 vue (au cours des 30 derniers jours)
abdullah al-dulaimi
abdullah al-dulaimi le 29 Déc 2022
Commenté : Jan le 29 Déc 2022
A=rand(1, 100)
For each 10 rows, i want to find max value

Réponse acceptée

Jan
Jan le 29 Déc 2022
Modifié(e) : Jan le 29 Déc 2022
With the bold guess, that you mean rand(100, 1) instead of rand(1:100):
data = rand(100, 1);
result = max(reshape(data, 10, 10))
% or explicitly:
result = max(reshape(data, 10, 10), [], 1)
  3 commentaires
Jan
Jan le 29 Déc 2022
@abdullah al-dulaimi: "the result will be 9 19 29 39 49 59 69 79 89 99"?
Do you mean:
x = 9:10:100

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Polar Plots dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by