Replacing part of a matrix with a matrix

22 visualizaciones (últimos 30 días)
Nick
Nick el 23 de Sept. de 2014
Comentada: Nick el 23 de Sept. de 2014
Hey guys,
I need to replace part of a matrix with a matrix of zeroes. For simplicity lets just say,
A = [1,2,3;4,5,6;7,8,9]
I would like to replace the top left 2x2 with a matrix of zeroes. How do I do this using matlab commands?
Thanks

Respuesta aceptada

Youssef  Khmou
Youssef Khmou el 23 de Sept. de 2014
you can try :
A(1:2,1:2)=0;

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by