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.math.mathematica

Topic: Not-understandable warning
Replies: 1   Last Post: Apr 8, 2013 12:05 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
JikaiRF@aol.com

Posts: 18
Registered: 12/7/04
Not-understandable warning
Posted: Apr 6, 2013 9:54 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dear members:

I have a difficulty to understand programming in Mathematica.

I input the following, based on a textbook titled ``Programming with Mathematica: An Introduction" by Paul Wellin, which is published by Cambridge University Press.

mat = SparseArray[{i_, i_} \[RightArrow] 1, {4, 4}]

Then, I received an answer as

SparseArray[{i_, i_} \[RightArrow] 1, {4, 4}]

with a warning as

`` SparseArray::list: "List expected at position 1 in SparseArray[{i_, i_} \[RightArrow] 1, {4, 4}]".

In this textbook, on page 32, there appears a correct answer as follows:

SparseArray[<4>, {4,4}].

Why my Mathematica cannot understand my input?

By the way, I use Mathematica 8.0.4.0 version and Mac OS 10.5.8.

Sincerely,
Fujio Takata.









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.