Hi

Some comments, since it did not work as expected.


> On 21.04.2024 19:40, Uwe Brauer wrote:

> Your approach is indeed cumbersome.

> In mine we need to:

> 1. Install `matlab-support` - a  debian package that enables matlab 
> integration within the system:

> sudo apt install matlab-support

installed

> 2. In Emacs: install `matlab-mode` package

installed
> 3. Download

> https://github.com/karthink/.emacs.d/blob/master/plugins/ob-octave-fix.el

Installed 

> and put it somewhere  in Emacs search path.

> 4. My init.el content with matlab/org-babel configurations:

> ;; 
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;; enabling org-babel
> (org-babel-do-load-languages
>   'org-babel-load-languages '(
>                   (C . t) ; enable processing C, C++, and D source blocks
>                   (matlab . t)
>                   ;;(perl . t)
>                   (octave . t)
>                   (org . t)
>                   (python . t)
>                               (plantuml . t)
>                   (shell . t)
>                    ))

> ;; setup matlab in babel
> (setq org-babel-default-header-args:matlab
>    '((:results . "output") (:session . "*MATLAB*")))

> ;; octave/matlab-fix
> ;;;; (require 'ob-octave-fix nil t)    ; This is for older approach
> (require 'ob-octave-fix)

done.


Now I executed 

#+begin_src matlab 
x = [1, 2, 3, 4, 5];
fprintf('|%d', x)
#+end_src

And obtained in a different window:
--8<---------------cut here---------------start------------->8---

NameErrorTraceback (most recent call last)
<ipython-input-3-e039b5096438> in <module>
      1 x = [1, 2, 3, 4, 5];
----> 2 fprintf('|%d', x)

NameError: name 'fprintf' is not defined

--8<---------------cut here---------------end--------------->8---

So 

    1. the result is not inserted in my org buffer,

    2. Morever fprintf is not defined, let me suspect this is not matlab
       what is excecuted but octave. Am I right?

What do I miss here?


Uwe 
-- 
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Matlab-emacs-discuss mailing list
Matlab-emacs-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss

Reply via email to