package import problem in mathematica

前端 未结 2 657
眼角桃花
眼角桃花 2021-01-06 02:46

In mathematica (I am using mma 5.0 ( guess pretty old)), if I type the following as one line:

Needs[\"Graphics`Master`\"]; Animate[Plot[Sin[n x], {x, 0, 2 Pi         


        
2条回答
  •  天命终不由人
    2021-01-06 03:23

    You are supposed to put the Needs[] call(s) at the top of a notebook in a separate block, or on the first isolated line of a package.m file.

    The kernel reads the whole line and parses it, including deciding on the contexts for symbols, before beginning to evaluate it. To avoid problems, do not use semicolons. Put two newlines after every statement in a package. Especially after the BeginPackage[] and/or Needs[].

提交回复
热议问题