org-mode/testing/examples/ob-octave-test.org

56 lines
1.1 KiB
Org Mode

#+Title: a collection of examples for ob-octave tests
#+OPTIONS: ^:nil
* Simple tests
:PROPERTIES:
:ID: 54dcd61d-cf6c-4d7a-b9e5-854953c8a753
:END:
Number output
#+begin_src octave :exports results :results silent
ans = 10
#+end_src
Array output
#+begin_src octave :exports results :results silent
ans = 1:4'
#+end_src
* Input tests
:PROPERTIES:
:ID: cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba
:END:
Input an integer variable
#+begin_src octave :exports results :results silent :var s=42
ans = s
#+end_src
Input an array
#+begin_src octave :exports results :results silent :var s='(1.0 2.0 3.0)
ans = s
#+end_src
Input a matrix
#+begin_src octave :exports results :results silent :var s='((1 2) (3 4))
ans = s
#+end_src
Input a string
#+begin_src octave :exports results :results silent :var s="test"
ans = s(1:2)
#+end_src
Input elisp nil
#+begin_src octave :exports results :results silent :var s='nil
ans = s
#+end_src
* Graphical tests
#+begin_src octave :results graphics :file chart.png
sombrero;
#+end_src
#+begin_src octave :session
sombrero;
#+end_src