Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: how to insert/delete rows in a matrix without copy the rest of matrix
Date: Wed, 25 Jul 2007 13:50:59 +0000 (UTC)
Organization: No matter
Lines: 17
Message-ID: <f87kg3$9ri$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-01-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1185371459 10098 172.30.248.36 (25 Jul 2007 13:50:59 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 25 Jul 2007 13:50:59 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 859211
Xref: news.mathworks.com comp.soft-sys.matlab:420984



Matlab is very slow add/delete a row in a matrix.
It always trying to copy the whole matrix
e.g., 

a = rand(5000);
tic
a(:,1) = [];
toc
tic
a = [a(:,1),a];
toc
Elapsed time is 0.447241 seconds.
Elapsed time is 0.556416 seconds.

I need to insert/delete a row into a large matrix.
How to make it fast?