Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: sparse matrix operation in V5.x
Replies: 2   Last Post: May 4, 1998 2:18 AM

 Messages: [ Previous | Next ]
 H.J. Wang Posts: 12 Registered: 12/7/04
sparse matrix operation in V5.x
Posted: Apr 30, 1998 10:24 AM

Hi,

I found that there is a difference of sparse matrix operations between
version 4.x and 5.x. If X is a sparse matrix, in version 4.x I can do
something like
Y(1:20,:) = X(5:24,:)
. (This is just a simplified example of a more complicated task.)
However, when I try to do the same with version 5.x I got the message
"??? In an assignment A(:,matrix) = B, the number of rows in A and B
must be the same."
It seems I can only get around by first convert the sparse matrix to
full matrix, X = full(X), and then do the operation. It seems to me
that this approach violates the purpose of having sparse matrix in the
first place, and is not practical to me since the matrix X is very
large. Is there anyway I can preserve X as a sparse matrix and still
accomplish the operation? Thanks in advance.

H.J. Wang

Date Subject Author
4/30/98 H.J. Wang
4/30/98 H.J. Wang
5/4/98 Axel Hecht