您需要正确指定目标.
A=ones(6,6); A(3:4,3:4) = A(3:4,3:4)*5 A = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 5 1 1 1 1 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1