The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   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
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


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

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.