|
SOLUTIONS
|
MATHEMATICA 指南
Mathematica 语法
Mathematica 为它的多种语言、数学运算和其他结构精心设计了丰富、高效、易读的语法. 此外还加入了普通的线性 ASCII 码,同时 Mathematica 支持全部的二维数学输入.
参考资料参考资料
基本语法
{...} (List) ▪ "..." (String) ▪ e[[i]] (Part) ▪ e[[i;;j]] (Span)
基本运算
x==val — 测试相等性,或表示一个符号方程(!= 表示不相等)
lhs:=rhs — 函数等的定义
a->b, a→b — 转换、选项等的规则 (:> 表示延迟应用规则)
expr/.rule — 使用规则替代 ("斜线与点")
数学运算与操作
+ ▪ - ▪ * ▪ / ▪ ^ (Power) ▪ && (And) ▪ || (Or) ▪ ! (Not) ▪ <> (StringJoin)
模式
x_ — 任意表达式("x 空格")
x__, x___ — 任意表达式序列 ("x 双空格", ......)
x:p — 模式名称
p:d — 默认模式
.. (Repeated) ▪ | (Alternatives) ▪ /; (Condition) ▪ ? (PatternTest)
纯函数
expr& — 纯函数
简易格式
f@expr — 前缀函数的应用
expr//f — 后缀函数的应用("斜线 斜线")
/@ (Map — "斜线 @") ▪ @@, @@@ (Apply) ▪ ~~ (StringExpression) ▪ === (SameQ)
程序语法
expr;expr;expr — 命令的顺序(CompoundExpression)
<<file — 输入文件 (>>file,>>>file 用来输出一个文件)
Mathematica 会话语法
?x — 符号
的信息
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
