Question

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.

Était-ce utile?

La solution

Delete them in one go -

mat(:,ind)=[];
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top