Mathematica 9 中语句不显示错误,不运行结果?
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/05/15 13:34:13
Mathematica 9 中语句不显示错误,不运行结果?
For[n = 1,n {"x/a",
"\!\(\*FractionBox[\(a\),\(2\)]\)|\[Psi]\!\(\*SuperscriptBox[\(|\
\),\(2\)]\)"},PlotLabel -> "n=4",AspectRatio -> 1/3]]
For[n = 1,n {"x/a",
"\!\(\*FractionBox[\(a\),\(2\)]\)|\[Psi]\!\(\*SuperscriptBox[\(|\
\),\(2\)]\)"},PlotLabel -> "n=4",AspectRatio -> 1/3]]
原因是,除非使用明确的 Return,否则由 For 返回的最后的值是Null.所以,在循环完之后,没有返回值作为Out输出.一个简单的方法是,在Plot函数外套一个Print函数.另外程序中PlotLabel -> "n=4"要改成PlotLabel -> StringForm["n=``", n],否则n不能传递到字符串中.但是,这不是Mathematica的做事风格.Mathematica的风格是函数式编程,而不是过程式编程,因此,将上述代码变成Table[Plot[Sin[n*\[Pi]*x]^2, {x, 0, 1},
AxesLabel -> {"x/a",
"\!\(\*FractionBox[\(a\), \
\(2\)]\)|\[Psi]\!\(\*SuperscriptBox[\(|\), \(2\)]\)"},
PlotLabel -> StringForm["n=``", n], AspectRatio -> 1/3], {n, 1, 5}]更自然一些
AxesLabel -> {"x/a",
"\!\(\*FractionBox[\(a\), \
\(2\)]\)|\[Psi]\!\(\*SuperscriptBox[\(|\), \(2\)]\)"},
PlotLabel -> StringForm["n=``", n], AspectRatio -> 1/3], {n, 1, 5}]更自然一些
在mathematica中怎么计算下面的积分,为什么不显示结果呢?
mathematica不显示图形是什么情况?
在excel中,如何不显示结果,而是显示公式?
Mathematica中画图时怎么用对数坐标显示结果?
mathematica不能显示计算结果
mathematica中下标怎么不参与计算
电子表格输入随机数公式不显示结果
2007excel 怎样不显示公式,只显示结果?
请问高手:excel表中计算结果单元格中,等于零的数据不显示,怎样做?
EXCEL中公式不自动计算了怎么办,一定要保存了才显示计算结果
下面的matlab程序错误在哪里?怎么不运行?
在EXCEL2007中,·如何在输入公式后,求结果,要是结果等于零时,不显示零