Write a program that creates a vector, v, containing the absolute value of the difference between the maximum and minimum values in each row of A. A =[66 94 75 18
Mostrar comentarios más antiguos
Write a program that creates a vector, v, containing the absolute value of the difference between the maximum and minimum values in each row of A.
A =[66 94 75 18
4 68 40 71
85 76 66 4]
Note that the built-in max and min function give the mins and maxes in each column.
1 comentario
Respuestas (1)
A =[66 94 75 18
4 68 40 71
85 76 66 4] ;
iwant = max(A,[],2)-min(A,[],2)
2 comentarios
Gabriel Serrano
el 17 de Feb. de 2022
KSSV
el 17 de Feb. de 2022
REad about the function min and max, you can proivde the dimension across which you seek the minimum and maximum.
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!