Subtract raws of a matrix from an array
Mostrar comentarios más antiguos
Given the following array
Q= [42 42 42 42 42 42 ]
and a matrix M
M= [33 38 31 37 35 37 ;
36 33 33 33 31 35 ;
31 31 27 35 30 38 ;
37 28 36 36 30 33 ;
34 30 34 30 30 33 ;
32 27 29 34 37 29 ;
36 33 35 31 33 34 ;
39 29 28 35 32 37 ;
34 28 36 32 35 31 ;
37 36 25 33 35 34 ;
36 36 31 37 33 37 ;
32 32 32 33 36 35 ;
36 36 31 33 33 37 ;
33 35 30 31 32 32 ;
33 30 35 38 34 34 ;
33 35 34 32 32 32 ]
I want to obtain a matrix C with the difference between the raw of Q and each raw of M, obtaining
C= [9 4 11 5 7 5;
6 9 9 9 11 7;
...]
Does someone can help me?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Matrix Indexing 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!