Replacing part of a matrix with a matrix

조회 수: 23 (최근 30일)
Nick
Nick 2014년 9월 23일
댓글: Nick 2014년 9월 23일
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

채택된 답변

Youssef  Khmou
Youssef Khmou 2014년 9월 23일
you can try :
A(1:2,1:2)=0;

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by