Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

Topic: sparse matrix question
Replies: 1   Last Post: Jul 16, 1996 7:08 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Tzu-Yi Chen

Posts: 1
Registered: 12/7/04
sparse matrix question
Posted: Jul 10, 1996 8:54 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I'm running across a problem in which Matlab seems to have
two ways of reading its sparse matrix format. There's a
short example at the end. If anyone else has seen anything
like it and/or knows what might be causing it, I'd like to
know. B is a sparse matrix returned by a mex file. If I
convert B into a full matrix and then back to a sparse
matrix, the problem disappears. I only see this problem
with certain matrices (e.g. upper triangular).

Many thanks!

-Yi Chen
tzuyi@cs.berkeley.edu

>> R
R =
-2.2361 0.0440 1.5095 -1.0373 -0.7109
0 -2.6664 -0.8325 0.4838 -0.1787
0 0 -0.8025 -1.4912 -0.1387
0 0 0 -0.5565 -0.4982
0 0 0 0 -0.1676

>> full(B)
ans =
-2.2361 0.0440 1.5095 -1.0373 -0.7109
0 -2.6664 -0.8325 0.4838 -0.1787
0 0 -0.8025 -1.4912 -0.1387
0 0 0 -0.5565 -0.4982
0 0 0 0 -0.1676

>> R(1,4)
ans =
-1.0373

>> B(1,4)
ans =
0

>> R(1,4)-B(1,4)
ans =
-1.0373

>> all(all(~(R-B)))
ans =
1





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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.