I have a matrix of size 139 X 143896.

I have to delete 6000 columns from it.

Currently I am using a for loop to do it and it is really slow.

Is there any faster way to do this?

for i=1:length(ind)
   %ind are the indices of the columns to be removed
   col1=ind(i);
   mat(:,col1)=[];
end

Any help is greatly welcome.

有帮助吗?

解决方案

Delete them in one go -

mat(:,ind)=[];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top