Skip to main content
added 37 characters in body
Source Link
NickD
  • 36.2k
  • 4
  • 33
  • 50

I am trying to pass the value of an octave/matlab array into a python code block in org-mode. But I can't get the python-end to receive the value.

With the answers in this question, I can generate an org-mode table from a matlab array a as follows:

#+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


#+NAME: test-output-value
#+BEGIN_SRC octave :session test_case :results value :colnames yes :hline yes
  ans = a
#+END_SRC

#+RESULTS: test-output-value
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |

However, when I try to pass the results of the matlab-generated table to python, I get no output from python:

#+NAME: ocatveoctave-to-python
#+BEGIN_SRC python :var a=test-output-value :results value :exports none
  len(a)
#+END_SRC

#+RESULTS: ocatveoctave-to-python
: None

Can anyone help explain how to make the chaining above work?

(This is with default Emacs 26, Python 3.8 of Ubuntu 20.04 LTS).

I am trying to pass the value of an octave/matlab array into a python code block in org-mode. But I can't get the python-end to receive the value.

With the answers in this question, I can generate an org-mode table from a matlab array a as follows:

#+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


#+NAME: test-output-value
#+BEGIN_SRC octave :session test_case :results value :colnames yes :hline yes
  ans = a
#+END_SRC

#+RESULTS: test-output-value
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |

However, when I try to pass the results of the matlab-generated table to python, I get no output from python:

#+NAME: ocatve-to-python
#+BEGIN_SRC python :var a=test-output-value :results value :exports none
  len(a)
#+END_SRC

#+RESULTS: ocatve-to-python
: None

Can anyone help explain how to make the chaining above work?

(This is with default Emacs 26, Python 3.8 of Ubuntu 20.04 LTS).

I am trying to pass the value of an octave/matlab array into a python code block in org-mode. But I can't get the python-end to receive the value.

With the answers in this question, I can generate an org-mode table from a matlab array a as follows:

#+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


#+NAME: test-output-value
#+BEGIN_SRC octave :session test_case :results value :colnames yes :hline yes
  ans = a
#+END_SRC

#+RESULTS: test-output-value
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |

However, when I try to pass the results of the matlab-generated table to python, I get no output from python:

#+NAME: octave-to-python
#+BEGIN_SRC python :var a=test-output-value :results value :exports none
  len(a)
#+END_SRC

#+RESULTS: octave-to-python
: None

Can anyone help explain how to make the chaining above work?

(This is with default Emacs 26, Python 3.8 of Ubuntu 20.04 LTS).

Commonmark migration
Source Link

I am trying to pass the value of an octave/matlab array into a python code block in org-mode. But I can't get the python-end to receive the value.

With the answers in [this question][1]this question, I can generate an org-mode table from a matlab array a as follows:

#+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


#+NAME: test-output-value
#+BEGIN_SRC octave :session test_case :results value :colnames yes :hline yes
  ans = a
#+END_SRC

#+RESULTS: test-output-value
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |

However, when I try to pass the results of the matlab-generated table to python, I get no output from python:

#+NAME: ocatve-to-python
#+BEGIN_SRC python :var a=test-output-value :results value :exports none
  len(a)
#+END_SRC

#+RESULTS: ocatve-to-python
: None

Can anyone help explain how to make the chaining above work?

(This is with default Emacs 26, Python 3.8 of Ubuntu 20.04 LTS). [1]: How to output an octave array as a org-mode table?

I am trying to pass the value of an octave/matlab array into a python code block in org-mode. But I can't get the python-end to receive the value.

With the answers in [this question][1], I can generate an org-mode table from a matlab array a as follows:

#+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


#+NAME: test-output-value
#+BEGIN_SRC octave :session test_case :results value :colnames yes :hline yes
  ans = a
#+END_SRC

#+RESULTS: test-output-value
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |

However, when I try to pass the results of the matlab-generated table to python, I get no output from python:

#+NAME: ocatve-to-python
#+BEGIN_SRC python :var a=test-output-value :results value :exports none
  len(a)
#+END_SRC

#+RESULTS: ocatve-to-python
: None

Can anyone help explain how to make the chaining above work?

(This is with default Emacs 26, Python 3.8 of Ubuntu 20.04 LTS). [1]: How to output an octave array as a org-mode table?

I am trying to pass the value of an octave/matlab array into a python code block in org-mode. But I can't get the python-end to receive the value.

With the answers in this question, I can generate an org-mode table from a matlab array a as follows:

#+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


#+NAME: test-output-value
#+BEGIN_SRC octave :session test_case :results value :colnames yes :hline yes
  ans = a
#+END_SRC

#+RESULTS: test-output-value
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |

However, when I try to pass the results of the matlab-generated table to python, I get no output from python:

#+NAME: ocatve-to-python
#+BEGIN_SRC python :var a=test-output-value :results value :exports none
  len(a)
#+END_SRC

#+RESULTS: ocatve-to-python
: None

Can anyone help explain how to make the chaining above work?

(This is with default Emacs 26, Python 3.8 of Ubuntu 20.04 LTS).

Source Link
tinlyx
  • 1.5k
  • 1
  • 15
  • 29

How to export an octave/matlab array for use by python in org-mode?

I am trying to pass the value of an octave/matlab array into a python code block in org-mode. But I can't get the python-end to receive the value.

With the answers in [this question][1], I can generate an org-mode table from a matlab array a as follows:

#+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


#+NAME: test-output-value
#+BEGIN_SRC octave :session test_case :results value :colnames yes :hline yes
  ans = a
#+END_SRC

#+RESULTS: test-output-value
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |

However, when I try to pass the results of the matlab-generated table to python, I get no output from python:

#+NAME: ocatve-to-python
#+BEGIN_SRC python :var a=test-output-value :results value :exports none
  len(a)
#+END_SRC

#+RESULTS: ocatve-to-python
: None

Can anyone help explain how to make the chaining above work?

(This is with default Emacs 26, Python 3.8 of Ubuntu 20.04 LTS). [1]: How to output an octave array as a org-mode table?