算数操作

1
2
3
4
5
6
7
Plus[1,2]
Subtract[5,2]
Times[1,2]
Divide[4,2]
Max[2,3]
Min[2,3]
RandomInteger[100]

列表

1
{1,2,3,4,5}

散点图

1
ListPlot[{10, 9, 8, 7, 3, 2, 1}]

转置

1
Reverse[{1, 2, 3, 4}]

范围

1
Range[10]

合并

1
Join[Range[3], Range[5]]

图表

折线图

1
ListLinePlot[{1, 3, 5, 4, 1, 2, 1, 4}]

散点图

1
ListPlot[{1, 3, 5, 4, 1, 2, 1, 4}]

柱状图

1
BarChart[{1, 3, 5, 4, 1, 2, 1, 4}]

饼图

1
PieChart[{1, 3, 5, 4}]

数轴

1
NumberLinePlot[{1, 7, 11, 25}]

1
Column[{100, 350, 502, 400}]

以上图表可以作为对象同时输出

列表运算

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{1, 2, 3}+10
{1, 1, 2} * {1, 2, 3}
Range[10]^ 2
Sort[{4, 2, 1, 3, 6}]
Length[{5, 3, 4, 5, 3, 4, 5}]
Total[{1, 1, 2, 2}]
Count[{a, b, a, a, c, b, a}, a]
First[{7, 6, 5}]
Last[{7, 6, 5}]
Part[{7, 6, 5}, 2]
IntegerDigits[1988, 2]
Take[{101, 203, 401, 602, 332, 412}, 3]
Drop[{101, 203, 401, 602, 332, 412}, 3]
Rest[{1,1,2}]
Most[{1,1,2}]

Table函数

1
2
3
4
5
6
7
8
Table[5, 10]
Table[x, 10]
Table[PieChart[{1, 1, 1}], 3]
Table[a[n], {n, 5}]
Table[n+1, {n, 10}]
Table[Range[n], {n, 5}]
Table[{x, x+1, x^ 2}, {x, 5}]
Table[f[n], {n, 4, 10, 2}]