Vector array from matrix
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
SANTHOSH s
el 29 de Nov. de 2019
Editada: Dhananjay Kumar
el 4 de Dic. de 2019
Can anyone suggest me the general code for finding the difference between maximum and minimum value in a higher order matrix to get each row answers in vector form.
2 comentarios
dpb
el 29 de Nov. de 2019
Use the optional argument to the min max functions to operate on the desired dimension...
Respuesta aceptada
Dhananjay Kumar
el 4 de Dic. de 2019
Editada: Dhananjay Kumar
el 4 de Dic. de 2019
If A = [1 0 5; 6 -9 -5; 1 2 5; 0 0.9 -2]
then min(A,[],2) gives a column vector containing minimum value of each row. Similarly for max(A,[],2).
>> min(A,[],2)
ans =
0
-9
1
-2
(Here third argument is to specify dimension along which to find min/max)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!