1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
| | * Test org maxima file
#+begin_src maxima :var s=4 :results silent
print(s);
#+end_src
Pass a string
#+begin_src maxima :var fun="sin(x)" :var q=2 :results silent
print(diff(fun, x, q));
#+end_src
Graphic output
#+begin_src maxima :var a=0.5 :results graphics :file maxima-test-sin.png
plot2d(sin(a*x), [x, 0, 2*%pi])$
#+end_src
#+begin_src maxima :results graphics :file maxima-test-3d.png
plot3d (2^(-u^2 + v^2), [u, -3, 3], [v, -2, 2])$
#+end_src
Output to a file
#+begin_src maxima :file maxima-test-ouput.out
for i:1 thru 10 do print(i)$
#+end_src
List as input
#+begin_src maxima :var a=(list 1 2 3)
print(a+1);
#+end_src
#+begin_src maxima :var a=(list 1 (list 1 2) 3)
print(a+1);
#+end_src
#+tblname: test_tbl_col
| 1.0 |
| 2.0 |
#+tblname: test_tbl_row
| 1.0 | 2.0 |
Extra bracket? TODO:
#+begin_src maxima :var s=test_tbl_col
print(s+1.0);
#+end_src
#+begin_src maxima :var s=test_tbl_row
print(s+1.0);
#+end_src
Matrix
#+tblname: test_tbl_mtr
| 1.0 | 1.0 |
| 0.0 | 4.0 |
#+begin_src maxima :var s=test_tbl_mtr
ms: apply(matrix, s);
print(ms^^2);
#+end_src
#+begin_src maxima :var s=test_tbl_mtr
ms: apply(matrix, s);
print(ms^^2);
#+end_src
|