how velocize it? (vectorize it)
    8 次查看(过去 30 天)
  
       显示 更早的评论
    
 a=magic(8)
 b=[1 3 2 4 5 5 8 3] %  (b is always >0)
[~,c]=size(a);
B=a;
for i=1:c
    if b(i)>1
      B(1:b(i)-1,i)=0;
    end
end    
B
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

