Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



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



