MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Not-understandable warning

  • To: mathgroup at
  • Subject: [mg130385] Not-understandable warning
  • From: JikaiRF at
  • Date: Sat, 6 Apr 2013 21:53:06 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:

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 version and Mac OS 10.5.8.

      Fujio Takata.


  • Prev by Date: Re: extract from Reduce
  • Next by Date: Re: "Displaying" the meaning of zero
  • Previous by thread: State Space Model bug in 9.0.1
  • Next by thread: Re: Not-understandable warning