How to obtain max value form Matrix A B C , and write to Matrix D
    3 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    PRED LIU
 el 18 de Mayo de 2020
  
    
    
    
    
    Respondida: Star Strider
      
      
 el 18 de Mayo de 2020
            How to obtain max value form Matrix A B C , and  write to Matrix D ,as below 
Matrix  A 
1	1	6
1	17	1
23	18	1
Matrix  B
3	8	3
18	20	3
3	21	3
Matrix C
10	2	2
2	2	24
2	2	25
%%%%%%%%%%%%%%%%%
Matrix D
10	8	6
18	20	24
23	21	25
0 comentarios
Respuesta aceptada
  Star Strider
      
      
 el 18 de Mayo de 2020
        First use the cat function to concatenate them, then use the max function over the third dimension: 
D = max(cat(3, Matrix_A, Matrix_B, Matrix_C),[],3)
producing: 
D =
    10     8     6
    18    20    24
    23    21    25
.
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Creating and Concatenating Matrices 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!

