Respuesta aceptada

Jan
Jan el 29 de Dic. de 2022
Editada: Jan el 29 de Dic. de 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 comentarios

brother if i want max-1, i mean the result will be 9 19 29 39 49 59 69 79 89 99, how will be the code?
are you looking for maximum value minus 1? If so subtract 1 from result
Or are you looking for the indices where the maximums appear? Or for the indices where the second highest appear?
@abdullah al-dulaimi: "the result will be 9 19 29 39 49 59 69 79 89 99"?
Do you mean:
x = 9:10:100

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 29 de Dic. de 2022

Comentada:

Jan
el 29 de Dic. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by