I am trying to output a matlab/octave array as an org-mode table. So for an array/matrix like
a =[ 1 2; 3 4; 5 6];
I'd like to have a 3 by 2 org-mode table. I tried to just echo the array a
as if in matlab, but it does not work. I am wondering how to make the output work.
More specifically, for an input array:
#+name: test-data
#+begin_src octave :session test_case :exports both
a =[ 1 2; 3 4; 5 6];
#+end_src
#+RESULTS: test-data
: org_babel_eoe
I can generate its size
as a table:
#+NAME: test-output-size
#+BEGIN_SRC octave :session test_case :results value :colnames yes :hline yes
size(a)
#+END_SRC
#+RESULTS: test-output-size
| 3 | 2 |
But when I tried to print the array a
itself as a table, I got no output:
#+NAME: test-output-value
#+BEGIN_SRC octave :session test_case :results value :colnames yes :hline yes
a
#+END_SRC
#+RESULTS: test-output-value
: org_babel_eoe
I also tried disp()
, to no avail. So my question is:
What is the proper way to output an array as a table?
(This is with the Emacs 26 in Ubuntu 20.04 LTS)