已知A矩阵为:
4 20 12 8
3 15 0 40
8 22 12 36
11 30 18 46
将A中元素能被3整除的,全部置0
要求输出
4 20 0 8 0 0 0 40 8 22 0 0 11 0 0 46
A=[4,20,12,8;3,15,0,40;8,22,12,36;11,30,18,46]; p=rem(A,3)==0; k=find(p==1); A(k)=0; disp(num2str(A));
标签:11,12,15,22,46,40,20 From: https://www.cnblogs.com/lachesism/p/16732810.html