Matlab Delete Row or Col 删除矩阵的行或列

 

Matlab中,我们有时候要删除矩阵中的某行某列,可以采用下列方法进行删除:

 

a = [
1 2 3
4 5 6
7 8 9];

a(2,:) = []; % Delete row 2
a(:,2) = []; % Delete col 2

 

posted @ 2015-10-14 04:33  Grandyang  阅读(2376)  评论(0编辑  收藏  举报
Fork me on GitHub