You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
(1) |
Jul
(1) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(7) |
Aug
(1) |
Sep
(5) |
Oct
|
Nov
(6) |
Dec
(3) |
2010 |
Jan
|
Feb
(10) |
Mar
(12) |
Apr
(13) |
May
(2) |
Jun
(4) |
Jul
(4) |
Aug
(4) |
Sep
|
Oct
(4) |
Nov
(2) |
Dec
(4) |
2011 |
Jan
(11) |
Feb
|
Mar
(18) |
Apr
|
May
(1) |
Jun
(12) |
Jul
(10) |
Aug
(4) |
Sep
(4) |
Oct
(5) |
Nov
|
Dec
(10) |
2012 |
Jan
(4) |
Feb
(26) |
Mar
|
Apr
(1) |
May
|
Jun
(8) |
Jul
(3) |
Aug
(1) |
Sep
|
Oct
(14) |
Nov
(1) |
Dec
(2) |
2013 |
Jan
(5) |
Feb
(2) |
Mar
(2) |
Apr
(5) |
May
(3) |
Jun
|
Jul
(8) |
Aug
(4) |
Sep
|
Oct
(7) |
Nov
(2) |
Dec
(7) |
2014 |
Jan
(14) |
Feb
|
Mar
(6) |
Apr
|
May
(3) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(7) |
Oct
(9) |
Nov
(9) |
Dec
(5) |
2015 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
(2) |
May
(1) |
Jun
(10) |
Jul
(3) |
Aug
(4) |
Sep
(8) |
Oct
(1) |
Nov
(3) |
Dec
(3) |
2016 |
Jan
(12) |
Feb
(59) |
Mar
(23) |
Apr
(11) |
May
(4) |
Jun
(15) |
Jul
|
Aug
|
Sep
(9) |
Oct
(19) |
Nov
(12) |
Dec
(5) |
2017 |
Jan
(1) |
Feb
(5) |
Mar
(5) |
Apr
|
May
(2) |
Jun
|
Jul
(5) |
Aug
|
Sep
(3) |
Oct
(12) |
Nov
(15) |
Dec
|
2018 |
Jan
(7) |
Feb
(6) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(3) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
|
Dec
|
2019 |
Jan
(2) |
Feb
(9) |
Mar
(4) |
Apr
(9) |
May
(1) |
Jun
(1) |
Jul
(1) |
Aug
(3) |
Sep
|
Oct
(2) |
Nov
(6) |
Dec
(5) |
2020 |
Jan
(9) |
Feb
|
Mar
(2) |
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(28) |
Dec
(5) |
2021 |
Jan
(11) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(15) |
Jun
(9) |
Jul
(11) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(3) |
2022 |
Jan
(1) |
Feb
|
Mar
|
Apr
(9) |
May
(1) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
(4) |
Jun
|
Jul
(22) |
Aug
(3) |
Sep
|
Oct
(1) |
Nov
|
Dec
(14) |
2024 |
Jan
|
Feb
|
Mar
|
Apr
(17) |
May
(35) |
Jun
(1) |
Jul
(18) |
Aug
(31) |
Sep
(5) |
Oct
(18) |
Nov
(20) |
Dec
(9) |
2025 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Nidish N. B. <nid...@il...> - 2024-05-15 11:53:19
|
> > 1. Done. I've added it to the lisp_LISP variable in the Makefile and > > can confirm that it builds fine. > > > 2. This is correct. I found no reason to rewrite matlab-shell-run-cell > > since it works fine as is. Let me know if you feel otherwise. > > It still works fine, well with one exception at least for me, a cell > must end with an empty new line. For example > > %% > t=0:0.1:1 > x=sin(t) > %% > > Does not work while > > %% > t=0:0.1:1 > x=sin(t) > > %% > > does Yes this is true. This seems to be a restriction from matlab-shell-run-cell. I guess I'll just write a matlab-cell-shell-run-cell function that's more neatly integrated within the matlab-cell minor-mode. The real restriction with matlab-cell is that I'm assuming that the cell header is "%%" followed by at least a space character - if there's no character right after the "%%", then this is not recognized as a cell header. This comes from the matlab-cell-cellbreak-regexp variable (which can be customized, of course). I will change it to default to not requiring the space character after the "%%" since this makes more sense. > > Okay - I've added a short writeup under the "Commentary" section in > > matlab-cell.el. Let me know if this is what you had in mind. > > Well I thought of including in the docstring of matlab-cell-mode > > But maybe this just me but I use `C-h m' quite a bit. I've added the list of navigation functions to the docstring. > > Not sure I can do real testing today, but hopefully tomorrow. > > Uwe > I'll try to have the above edits done by then! Thanks! Nidish |
From: Uwe B. <ou...@ma...> - 2024-05-15 11:28:35
|
> 1. Done. I've added it to the lisp_LISP variable in the Makefile and > can confirm that it builds fine. > 2. This is correct. I found no reason to rewrite matlab-shell-run-cell > since it works fine as is. Let me know if you feel otherwise. It still works fine, well with one exception at least for me, a cell must end with an empty new line. For example %% t=0:0.1:1 x=sin(t) %% Does not work while %% t=0:0.1:1 x=sin(t) %% does > Okay - I've added a short writeup under the "Commentary" section in > matlab-cell.el. Let me know if this is what you had in mind. Well I thought of including in the docstring of matlab-cell-mode But maybe this just me but I use `C-h m' quite a bit. Not sure I can do real testing today, but hopefully tomorrow. 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. |
From: Nidish N. B. <nid...@il...> - 2024-05-15 07:57:11
|
>>>> "NNB" == Nidish Narayanaa Balaji<nid...@il...> writes: > Hi > > >> A few pointers: > >> The main features that the new minor-mode enables are: >> * It redefines the page-break character to "%%" so an overline is >> drawn over those, making it visually look better. >> * The current cell that point is in is highlighted by being boldfaced >> (this is customizable). >> * Convenience functions for moving point forward and backward by one >> cell (also support being called with prefix arguments). >> * Convenience functions for moving a cell up or down by a block >> (number-prefixes supported too). > After a very very brief testing, some comments: > > 1. Could you please include matlab-cell in the Makefile? > > 2. So I understand your code does not generalise in any way > matlab-shell-run-cell? 1. Done. I've added it to the lisp_LISP variable in the Makefile and can confirm that it builds fine. 2. This is correct. I found no reason to rewrite matlab-shell-run-cell since it works fine as is. Let me know if you feel otherwise. >> * Some more non-interactive convenience functions to help development. >> * I've not bound any of the functions to any keymap within the package >> yet. >> In my config though, these are the bindings I'm using (in case >> someone's interested): >> ("C-v" . 'matlab-cell-forward-cell) >> ("M-v" . 'matlab-cell-backward-cell) >> ("C-<return>" . matlab-shell-run-cell) >> ("C-c C-b" . (lambda () (interactive) >> (save-window-excursion >> (matlab-shell-run-cell)) >> (matlab-cell-forward-cell))) >> ("C-x n c" . 'matlab-cell-narrow-to-cell) >> ("M-[" . 'backward-paragraph) >> ("M-]" . 'forward-paragraph) >> ("C-c <down>" . 'matlab-cell-move-cell-down) >> ("C-c <up>" . 'matlab-cell-move-cell-up) >> I'll appreciate comments and suggestions! :) > Could you maybe enhance the documentation of matlab-cell-mode, for > example describe the navigation functions. Okay - I've added a short writeup under the "Commentary" section in matlab-cell.el. Let me know if this is what you had in mind. > The keyb binding is something we might discuss later > > Thanks for the code > > Uwe Thanks for taking a look! Nidish |
From: Uwe B. <ou...@ma...> - 2024-05-15 07:20:30
|
>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: Hi > A few pointers: > The main features that the new minor-mode enables are: > * It redefines the page-break character to "%%" so an overline is > drawn over those, making it visually look better. > * The current cell that point is in is highlighted by being boldfaced > (this is customizable). > * Convenience functions for moving point forward and backward by one > cell (also support being called with prefix arguments). > * Convenience functions for moving a cell up or down by a block > (number-prefixes supported too). After a very very brief testing, some comments: 1. Could you please include matlab-cell in the Makefile? 2. So I understand your code does not generalise in any way matlab-shell-run-cell? > * Some more non-interactive convenience functions to help development. > * I've not bound any of the functions to any keymap within the package > yet. > In my config though, these are the bindings I'm using (in case > someone's interested): > ("C-v" . 'matlab-cell-forward-cell) > ("M-v" . 'matlab-cell-backward-cell) > ("C-<return>" . matlab-shell-run-cell) > ("C-c C-b" . (lambda () (interactive) > (save-window-excursion > (matlab-shell-run-cell)) > (matlab-cell-forward-cell))) > ("C-x n c" . 'matlab-cell-narrow-to-cell) > ("M-[" . 'backward-paragraph) > ("M-]" . 'forward-paragraph) > ("C-c <down>" . 'matlab-cell-move-cell-down) > ("C-c <up>" . 'matlab-cell-move-cell-up) > I'll appreciate comments and suggestions! :) Could you maybe enhance the documentation of matlab-cell-mode, for example describe the navigation functions. The keyb binding is something we might discuss later Thanks for the code 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. |
From: Nidish N. B. <nid...@il...> - 2024-05-14 20:13:53
|
Okay I've pushed the first version of the cell utils. This is the first time I'm making a substantial contribution to a package, so please forgive me if something I'm doing is not how you'd rather have it - happy to learn! :) A few pointers: * All the new contributions are in a new branch called "matlab-cells": https://sourceforge.net/p/matlab-emacs/src/ci/matlab-cells/tree/ * I've dumped all the code in matlab-cell.el and made it a minor-mode. All the new variables and functions are prefixed with "matlab-cell-" * The new minor-mode is enabled by default by calling its setup function in the define-derived-mode of matlab-mode in matlab.el * I see that matlab-cellbreak-face already exists so perhaps there's some duplication of efforts - it would make sense to remove redundancies. * A large portion of the code is based on another package, python-cell : https://github.com/twmr/python-cell.el The main features that the new minor-mode enables are: * It redefines the page-break character to "%%" so an overline is drawn over those, making it visually look better. * The current cell that point is in is highlighted by being boldfaced (this is customizable). * Convenience functions for moving point forward and backward by one cell (also support being called with prefix arguments). * Convenience functions for moving a cell up or down by a block (number-prefixes supported too). * Some more non-interactive convenience functions to help development. * I've not bound any of the functions to any keymap within the package yet. In my config though, these are the bindings I'm using (in case someone's interested): ("C-v" . 'matlab-cell-forward-cell) ("M-v" . 'matlab-cell-backward-cell) ("C-<return>" . matlab-shell-run-cell) ("C-c C-b" . (lambda () (interactive) (save-window-excursion (matlab-shell-run-cell)) (matlab-cell-forward-cell))) ("C-x n c" . 'matlab-cell-narrow-to-cell) ("M-[" . 'backward-paragraph) ("M-]" . 'forward-paragraph) ("C-c <down>" . 'matlab-cell-move-cell-down) ("C-c <up>" . 'matlab-cell-move-cell-up) I'll appreciate comments and suggestions! :) Best, Nidish On 5/14/24 19:44, Nidish Narayanaa Balaji wrote: > On 5/14/24 19:37, Uwe Brauer wrote: >>> On 5/14/24 17:39, Uwe Brauer wrote: >>> Yes I do - my ID is: nidish96 >> Ok, so you should have write access now. >> >> BTW, maybe it is better you create a branch for testing and then I (or >> you merge that later into master)? >> so that at least we can do some testing. > > Thank you! > > And yes, I agree - I'll create a testing branch for my latest edits > and then you can test it out before merging! :) > > > > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss |
From: Nidish N. B. <nid...@il...> - 2024-05-14 17:45:04
|
On 5/14/24 19:37, Uwe Brauer wrote: >> On 5/14/24 17:39, Uwe Brauer wrote: >> Yes I do - my ID is: nidish96 > Ok, so you should have write access now. > > BTW, maybe it is better you create a branch for testing and then I (or > you merge that later into master)? > so that at least we can do some testing. Thank you! And yes, I agree - I'll create a testing branch for my latest edits and then you can test it out before merging! :) |
From: Uwe B. <ou...@ma...> - 2024-05-14 17:38:12
|
> On 5/14/24 17:39, Uwe Brauer wrote: > Yes I do - my ID is: nidish96 Ok, so you should have write access now. BTW, maybe it is better you create a branch for testing and then I (or you merge that later into master)? so that at least we can do some testing. -- 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. |
From: Nidish N. B. <nid...@il...> - 2024-05-14 17:23:24
|
On 5/14/24 17:39, Uwe Brauer wrote: >>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: >> Great! >> And yes, I had signed the FSF papers a while back. > > Great, I would need your sourceforge userid. > > In case you don't have one, please open a sourceforge account. Yes I do - my ID is: nidish96 > > Uwe >> Best, >> Nidish >> On 5/14/24 17:08, Uwe Brauer wrote: >>>>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: >>>> No worries - I look forward to hearing back. If I get push rights by >>>> the weekend, I'll push directly. If not, I'll make a patch and send >>>> it. >>> Eric and John let me decide, (great). >>> >>> Since I am trying since for more than a year to get the package into >>> ELPA, did you sign the FSF papers (I might have asked you that in the >>> past, but, memory, you know)? If not are you willing to do so? >>> >>> > |
From: Uwe B. <ou...@ma...> - 2024-05-14 15:40:19
|
>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: > Great! > And yes, I had signed the FSF papers a while back. Great, I would need your sourceforge userid. In case you don't have one, please open a sourceforge account. Uwe > Best, > Nidish > On 5/14/24 17:08, Uwe Brauer wrote: >>>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: >>> No worries - I look forward to hearing back. If I get push rights by >>> the weekend, I'll push directly. If not, I'll make a patch and send >>> it. >> Eric and John let me decide, (great). >> >> Since I am trying since for more than a year to get the package into >> ELPA, did you sign the FSF papers (I might have asked you that in the >> past, but, memory, you know)? If not are you willing to do so? >> >> -- 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. |
From: Nidish N. B. <nid...@il...> - 2024-05-14 15:11:58
|
Great! And yes, I had signed the FSF papers a while back. Best, Nidish On 5/14/24 17:08, Uwe Brauer wrote: >>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: >> No worries - I look forward to hearing back. If I get push rights by >> the weekend, I'll push directly. If not, I'll make a patch and send >> it. > Eric and John let me decide, (great). > > Since I am trying since for more than a year to get the package into > ELPA, did you sign the FSF papers (I might have asked you that in the > past, but, memory, you know)? If not are you willing to do so? > > |
From: Uwe B. <ou...@ma...> - 2024-05-14 15:09:05
|
>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: > No worries - I look forward to hearing back. If I get push rights by > the weekend, I'll push directly. If not, I'll make a patch and send > it. Eric and John let me decide, (great). Since I am trying since for more than a year to get the package into ELPA, did you sign the FSF papers (I might have asked you that in the past, but, memory, you know)? If not are you willing to do so? -- 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. |
From: Nidish N. B. <nid...@il...> - 2024-05-13 11:41:11
|
No worries - I look forward to hearing back. If I get push rights by the weekend, I'll push directly. If not, I'll make a patch and send it. I stand guilty of being called old-fashioned by colleagues too, so I do totally get it! ;-) Have a great week! Nidish On 5/13/24 12:49, Uwe Brauer wrote: >>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: > >> Here's a screenshot of how I have it setup now. The cells are >> delimited by a string that defaults to a regexp that matches for >> commented lines starting with "%%". It supports sending cells one by >> one to the shell and provides some nifty navigation & moving utils. I >> also have it setup so the current setup is bold-faced (see below). > Ok, that sounds quite interesting, I use cells quite a bit myself > > >> BTW, since you have contributed in the past: do you >> want write access so that you can push changes yourself? > >> That would be nice! > Let me ask also Eric and John, since I don't want to decide that myself, > but I am pretty sure that they will be delighted to have another > developer. > > >> Thank you > >> Uwe >> Footnotes: >> [1] did I mention that I am not a huge fan of merge requests 😇 > >> Hehe, fair enough. I'll try to make a patch this weekend! :-D > Great. Sorry for being so old fashioned. > |
From: Uwe B. <ou...@ma...> - 2024-05-13 10:49:14
|
>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: > Here's a screenshot of how I have it setup now. The cells are > delimited by a string that defaults to a regexp that matches for > commented lines starting with "%%". It supports sending cells one by > one to the shell and provides some nifty navigation & moving utils. I > also have it setup so the current setup is bold-faced (see below). Ok, that sounds quite interesting, I use cells quite a bit myself > BTW, since you have contributed in the past: do you > want write access so that you can push changes yourself? > That would be nice! Let me ask also Eric and John, since I don't want to decide that myself, but I am pretty sure that they will be delighted to have another developer. > Thank you > Uwe > Footnotes: > [1] did I mention that I am not a huge fan of merge requests 😇 > Hehe, fair enough. I'll try to make a patch this weekend! :-D Great. Sorry for being so old fashioned. -- 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. |
From: Uwe B. <ou...@ma...> - 2024-05-13 07:30:52
|
>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: > All, > I've implemented some additional cell block behavior that makes using > cells in matlab through emacs smoother. It's similar to the stock > matlab GUI experience but better (IMO ;) ). I am not sure what the stock matlab GUI experience is, but I rarely use the GUI.... > I was wondering where I should apply my patches since I remember a lot > of discussion on migrating to github. What's the current status on > this? John hasn't answered yet. I will ping him again. > Shall I go ahead and make a merge request on Sourceforge itself? Or just sending the patch.[1] BTW, since you have contributed in the past: do you want write access so that you can push changes yourself? Thank you Uwe Footnotes: [1] did I mention that I am not a huge fan of merge requests 😇 -- 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. |
From: Nidish N. B. <nid...@il...> - 2024-05-12 21:24:27
|
All, I've implemented some additional cell block behavior that makes using cells in matlab through emacs smoother. It's similar to the stock matlab GUI experience but better (IMO ;) ). I was wondering where I should apply my patches since I remember a lot of discussion on migrating to github. What's the current status on this? Shall I go ahead and make a merge request on Sourceforge itself? Thanks! Nidish |
From: Uwe B. <ou...@ma...> - 2024-04-27 07:16:22
|
> On 25.04.2024 21:55, martinoidar wrote: > Update: > I've just noticed that not everything is properly rendered in markdown > form. Thanks, but I still do not understand why *fprintf* is not supported and why the indenting should be important. When I have a bit more time, I will ask John explicitly 😇 since he seems to know quite a bit about that issue but who is also very occupied. Uwe > Here's a pdf version of the document: > https://github.com/cissic/temp-aux-repo/blob/main/2024-04-25-latex-output-from-matlab-octave-source-blocks.pdf -- 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. |
From: martinoidar <mar...@gm...> - 2024-04-25 20:07:35
|
On 25.04.2024 21:55, martinoidar wrote: > > On 23.04.2024 15:33, Uwe Brauer wrote: >>>>> "m" == martinoidar <mar...@gm...> writes: >> Hi >> >> I decided to start a new thread, since I made some progress and it seems >> there are at least two ways to execute matlab from an org buffer and >> insert the result back into that buffer. >> >> 1. Using the python engine matlab ships (I am not describing the >> setup now) >> Disadvantage >> a. Not all matlab releases support all ptyhon versions. For >> example ptyhon 3.5 is only supported till 2019a >> >> b. It takes some time for the python engine to start >> >> Advantage >> >> a. The format of the result is very nice. >> >> 2. Using the matlab-shell itself (thanks @Martin for pointing this >> out) >> Test Configuration: >> >> a. Start emacs -Q >> >> b. Load the following file >> >> --8<---------------cut here---------------start------------->8--- >> (setq load-path (cons (expand-file-name >> "~/emacs/site-lisp/packages/src/Matlab/HG-Git/matlab-sf-hg") load-path)) >> (load-file "/home/oub/emacs/init/custom-init-faces.el") >> (require 'company-matlab-shell) >> (require 'org) >> (require 'gdb-mi) >> (autoload 'matlab-mode "matlab" "Enter Matlab mode." t) >> (setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist)) >> (autoload 'matlab-shell "matlab" "Interactive Matlab mode." t) >> (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) >> )) >> >> (setq org-babel-default-header-args:matlab >> '((:results . "output") (:session . "*MATLAB*"))) >> >> --8<---------------cut here---------------end--------------->8--- >> >> And load ob-octave-fix.el >> https://github.com/karthink/.emacs.d/blob/master/plugins/ob-octave-fix.el >> >> Then the following code can be executed in a org buffer >> >> #+begin_src matlab :results output latex :exports results :eval >> never-export :wrap latex >> clear all >> x = [1, 2, 3, 4, 5]; >> disp(sprintf('|%d', x)) >> #+end_src >> >> #+RESULTS: >> #+begin_latex >> x = [1, 2, 3, 4, 5]; >> disp(sprintf('|%d', x)) >> |1|2|3|4|5 >> #+end_latex >> >> >> #+begin_src matlab :results output latex :exports results :eval >> never-export :wrap latex >> clear all >> x = [1, 2, 3, 4, 5]; >> disp(sprintf('|%d', x)) >> #+end_src >> >> #+RESULTS: >> #+begin_latex >> |1|2|3|4|5 >> #+end_latex >> >> That already indicates that the formatting needs care, moreover >> =fprintf= is not supported >> #+begin_src matlab :results output latex :exports results :eval >> never-export :wrap latex >> clear all >> x = [1, 2, 3, 4, 5] ; >> fprintf('|%d', x) >> #+end_src >> >> #+RESULTS: >> #+begin_latex >> #+end_latex >> >> So I need to investigate this a bit more. >> >> In summary: the second solution works surprisingly well and is faster >> than the python solution, but the formatting seems to me more restricted >> as in the python case. >> >> Any comments? >> >> Has anybody tried this out? >> >> @John you talked about such feature in the past. >> >> Can you confirm this behavior? >> >> Regards >> >> Uwe > > > Hi Uwe, > > My comments on the topic have grown to such a size that I decided it's > better to make a post from them. > > Please have a look here: > > https://cissic.github.io/posts/latex-output-from-matlab-octave-source-blocks/ > > > Regards, > > M > Update: I've just noticed that not everything is properly rendered in markdown form. Here's a pdf version of the document: https://github.com/cissic/temp-aux-repo/blob/main/2024-04-25-latex-output-from-matlab-octave-source-blocks.pdf |
From: martinoidar <mar...@gm...> - 2024-04-25 19:56:05
|
On 23.04.2024 15:33, Uwe Brauer wrote: >>>> "m" == martinoidar <mar...@gm...> writes: > Hi > > I decided to start a new thread, since I made some progress and it seems > there are at least two ways to execute matlab from an org buffer and > insert the result back into that buffer. > > 1. Using the python engine matlab ships (I am not describing the > setup now) > Disadvantage > a. Not all matlab releases support all ptyhon versions. For > example ptyhon 3.5 is only supported till 2019a > > b. It takes some time for the python engine to start > > Advantage > > a. The format of the result is very nice. > > 2. Using the matlab-shell itself (thanks @Martin for pointing this > out) > Test Configuration: > > a. Start emacs -Q > > b. Load the following file > > --8<---------------cut here---------------start------------->8--- > (setq load-path (cons (expand-file-name "~/emacs/site-lisp/packages/src/Matlab/HG-Git/matlab-sf-hg") load-path)) > (load-file "/home/oub/emacs/init/custom-init-faces.el") > (require 'company-matlab-shell) > (require 'org) > (require 'gdb-mi) > (autoload 'matlab-mode "matlab" "Enter Matlab mode." t) > (setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist)) > (autoload 'matlab-shell "matlab" "Interactive Matlab mode." t) > (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) > )) > > (setq org-babel-default-header-args:matlab > '((:results . "output") (:session . "*MATLAB*"))) > > --8<---------------cut here---------------end--------------->8--- > > And load ob-octave-fix.el > https://github.com/karthink/.emacs.d/blob/master/plugins/ob-octave-fix.el > > Then the following code can be executed in a org buffer > > #+begin_src matlab :results output latex :exports results :eval never-export :wrap latex > clear all > x = [1, 2, 3, 4, 5]; > disp(sprintf('|%d', x)) > #+end_src > > #+RESULTS: > #+begin_latex > x = [1, 2, 3, 4, 5]; > disp(sprintf('|%d', x)) > |1|2|3|4|5 > #+end_latex > > > #+begin_src matlab :results output latex :exports results :eval never-export :wrap latex > clear all > x = [1, 2, 3, 4, 5]; > disp(sprintf('|%d', x)) > #+end_src > > #+RESULTS: > #+begin_latex > |1|2|3|4|5 > #+end_latex > > That already indicates that the formatting needs care, moreover > =fprintf= is not supported > #+begin_src matlab :results output latex :exports results :eval never-export :wrap latex > clear all > x = [1, 2, 3, 4, 5] ; > fprintf('|%d', x) > #+end_src > > #+RESULTS: > #+begin_latex > #+end_latex > > So I need to investigate this a bit more. > > In summary: the second solution works surprisingly well and is faster > than the python solution, but the formatting seems to me more restricted > as in the python case. > > Any comments? > > Has anybody tried this out? > > @John you talked about such feature in the past. > > Can you confirm this behavior? > > Regards > > Uwe Hi Uwe, My comments on the topic have grown to such a size that I decided it's better to make a post from them. Please have a look here: https://cissic.github.io/posts/latex-output-from-matlab-octave-source-blocks/ Regards, M |
From: Uwe B. <ou...@ma...> - 2024-04-23 13:34:09
|
>>> "m" == martinoidar <mar...@gm...> writes: Hi I decided to start a new thread, since I made some progress and it seems there are at least two ways to execute matlab from an org buffer and insert the result back into that buffer. 1. Using the python engine matlab ships (I am not describing the setup now) Disadvantage a. Not all matlab releases support all ptyhon versions. For example ptyhon 3.5 is only supported till 2019a b. It takes some time for the python engine to start Advantage a. The format of the result is very nice. 2. Using the matlab-shell itself (thanks @Martin for pointing this out) Test Configuration: a. Start emacs -Q b. Load the following file --8<---------------cut here---------------start------------->8--- (setq load-path (cons (expand-file-name "~/emacs/site-lisp/packages/src/Matlab/HG-Git/matlab-sf-hg") load-path)) (load-file "/home/oub/emacs/init/custom-init-faces.el") (require 'company-matlab-shell) (require 'org) (require 'gdb-mi) (autoload 'matlab-mode "matlab" "Enter Matlab mode." t) (setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist)) (autoload 'matlab-shell "matlab" "Interactive Matlab mode." t) (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) )) (setq org-babel-default-header-args:matlab '((:results . "output") (:session . "*MATLAB*"))) --8<---------------cut here---------------end--------------->8--- And load ob-octave-fix.el https://github.com/karthink/.emacs.d/blob/master/plugins/ob-octave-fix.el Then the following code can be executed in a org buffer #+begin_src matlab :results output latex :exports results :eval never-export :wrap latex clear all x = [1, 2, 3, 4, 5]; disp(sprintf('|%d', x)) #+end_src #+RESULTS: #+begin_latex x = [1, 2, 3, 4, 5]; disp(sprintf('|%d', x)) |1|2|3|4|5 #+end_latex #+begin_src matlab :results output latex :exports results :eval never-export :wrap latex clear all x = [1, 2, 3, 4, 5]; disp(sprintf('|%d', x)) #+end_src #+RESULTS: #+begin_latex |1|2|3|4|5 #+end_latex That already indicates that the formatting needs care, moreover =fprintf= is not supported #+begin_src matlab :results output latex :exports results :eval never-export :wrap latex clear all x = [1, 2, 3, 4, 5] ; fprintf('|%d', x) #+end_src #+RESULTS: #+begin_latex #+end_latex So I need to investigate this a bit more. In summary: the second solution works surprisingly well and is faster than the python solution, but the formatting seems to me more restricted as in the python case. Any comments? Has anybody tried this out? @John you talked about such feature in the past. Can you confirm this behavior? Regards Uwe |
From: Uwe B. <ou...@ma...> - 2024-04-22 20:34:46
|
>>> "VC" == Vasco Cúrdia <vc...@gm...> writes: > I don't know how to contribute to this email discussions. So I'm not sure > if replying to this email is the correct way. > In response to latest "digest", regarding Github, I find that exchanging > views in Github "issues" is very straightforward and clean, while the > mailing lists are very cumbersome to process with too much copied content, > and hard to navigate. I couldn't disagree more. Email has a feature called threading, that indicates you graphically/visually which message is a reply to which. Issues just present a linear order of messages. If I want to reply to say the second message my answer is just appended at the end and therefore does not provide any visual aid of navigation. Moreover I read and write email in emacs, so I can use its power, insert matlab code search etc etc, while there does not exist any emacs for the issue system. Correct me please if I am wrong. These are the two main reasons, that I much prefer email/mailing list over the cumbersome, basic issue system. > I do not know if Gitlab is better than Github, but Github is way more > effective to exchange views on issues than the email exchange/digests. No it is not. It is just very popular and I understand this is the main reason why people want to have, at least a mirror, there. And BTW I am also not a huge fan of merging via the web interface, I prefer to do that on my private machine using the command line and emacs if needed and not some web interface (but this is just me). But as I said the correct repository should be chosen wisely (since there already a bewildering amount of matlab mirrors/forks) and I still have no write access to the matlab group of repositories. Regards Uwe Brauer -- 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. |
From: Vasco C. <vc...@gm...> - 2024-04-22 20:16:14
|
I don't know how to contribute to this email discussions. So I'm not sure if replying to this email is the correct way. In response to latest "digest", regarding Github, I find that exchanging views in Github "issues" is very straightforward and clean, while the mailing lists are very cumbersome to process with too much copied content, and hard to navigate. I do not know if Gitlab is better than Github, but Github is way more effective to exchange views on issues than the email exchange/digests. [image: Mailtrack] <https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&> Sender notified by Mailtrack <https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&> 04/22/24, 01:12:11 PM On Mon, Apr 22, 2024 at 12:47 PM < mat...@li...> wrote: > Send Matlab-emacs-discuss mailing list submissions to > mat...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss > or, via email, send a message with subject or body 'help' to > mat...@li... > > You can reach the person managing the list at > mat...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Matlab-emacs-discuss digest..." > > > Today's Topics: > > 1. Re: new branches, plans, rename development branch to > default, mirror to github (Uwe Brauer) > 2. Re: new branches, plans, rename development branch to > default, mirror to github (martinoidar) > 3. Re: new branches, plans, rename development branch to > default, mirror to github (Uwe Brauer) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 22 Apr 2024 14:52:39 +0200 > From: Uwe Brauer <ou...@ma...> > To: martinoidar <mar...@gm...> > Cc: Uwe Brauer <ou...@ma...>, > mat...@li... > Subject: Re: [Matlab-emacs-discuss] new branches, plans, rename > development branch to default, mirror to github > Message-ID: <87r...@ma...> > Content-Type: text/plain; charset="utf-8" > > > 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. > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: smime.p7s > Type: application/pkcs7-signature > Size: 5673 bytes > Desc: not available > > ------------------------------ > > Message: 2 > Date: Mon, 22 Apr 2024 19:35:33 +0200 > From: martinoidar <mar...@gm...> > To: Uwe Brauer <ou...@ma...> > Cc: mat...@li... > Subject: Re: [Matlab-emacs-discuss] new branches, plans, rename > development branch to default, mirror to github > Message-ID: <1cf...@gm...> > Content-Type: text/plain; charset=UTF-8; format=flowed > > > On 22.04.2024 14:52, Uwe Brauer wrote: > > 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 > > > Well... > > 1. After installing matlab-support you should be able to Matlab from > bash by typing the command > > >> matlab > > Can you do that? > > ?? a) if yes > > ?????? Can you evoke matlab-shell in Emacs? (M-x matlab-shell) > > ?????? Again, you should be able to do that after installing matlab-mode. > > ?? b) if no: > > ?????? check what are the values of the variables: > `matlab-shell-command` and `matlab-shell-command-switches` > > ?????? In my case they are equal: `matlab` and ("-nodesktop"), > respectively, which is by default set in `matlab-shell.el` which is a > part of matlab-mode package. > > ????? Maybe you need to set them explicitely like here: > > ???? https://swang251.github.io/2021/12/03/Matlab-in-Emacs/ > > ???? ??? > > > > > > > > ------------------------------ > > Message: 3 > Date: Mon, 22 Apr 2024 21:39:57 +0200 > From: Uwe Brauer <ou...@ma...> > To: martinoidar <mar...@gm...> > Cc: Uwe Brauer <ou...@ma...>, > mat...@li... > Subject: Re: [Matlab-emacs-discuss] new branches, plans, rename > development branch to default, mirror to github > Message-ID: <87p...@ma...> > Content-Type: text/plain; charset="utf-8" > > > > On 22.04.2024 14:52, Uwe Brauer wrote: > ----> 2 fprintf('|%d', x) > > > > Well... > > > 1. After installing matlab-support you should be able to Matlab from > > bash by typing the command > > Well, I am on tcsh, but this is not the point. > > > > > Can you do that? > > Yes I can, but mainly because during installation Matlab asks me to set > a symbolic link to /usr/local/bin > > So that is why > which matlab > > Return > /usr/local/bin/matlab > > > > ?? a) if yes > > > ?????? Can you evoke matlab-shell in Emacs? (M-x matlab-shell) > > > ?????? Again, you should be able to do that after installing matlab-mode. > > > Of course, I am using the matlab-shell very often, but from a matlab > file (.m) > > What I want to do is, to calculate > > 1. Matlab commands from an org buffer > > 2. And insert the result in that buffer. > > ?? b) if no: > > > ?????? check what are the values of the variables: > > `matlab-shell-command` and `matlab-shell-command-switches` > > > ?????? In my case they are equal: `matlab` and ("-nodesktop"), > > respectively, which is by default set in `matlab-shell.el` which is a > > part of matlab-mode package. > > > So it is in mine. > > Again, I use the matlab-shell very often but from .m files. > > I think I will start emacs -Q and load you configuration+minimal matlab > conf > and see what happens. > > I find in strange that in our case fprintf does not work. > It works for me in the matlab-shell and using my (complicated) python > engine solution > > 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. > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: smime.p7s > Type: application/pkcs7-signature > Size: 5673 bytes > Desc: not available > > ------------------------------ > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss > > > ------------------------------ > > End of Matlab-emacs-discuss Digest, Vol 115, Issue 5 > **************************************************** > |
From: Uwe B. <ou...@ma...> - 2024-04-22 19:47:53
|
> On 22.04.2024 14:52, Uwe Brauer wrote: ----> 2 fprintf('|%d', x) > Well... > 1. After installing matlab-support you should be able to Matlab from > bash by typing the command Well, I am on tcsh, but this is not the point. > Can you do that? Yes I can, but mainly because during installation Matlab asks me to set a symbolic link to /usr/local/bin So that is why which matlab Return /usr/local/bin/matlab > a) if yes > Can you evoke matlab-shell in Emacs? (M-x matlab-shell) > Again, you should be able to do that after installing matlab-mode. Of course, I am using the matlab-shell very often, but from a matlab file (.m) What I want to do is, to calculate 1. Matlab commands from an org buffer 2. And insert the result in that buffer. > b) if no: > check what are the values of the variables: > `matlab-shell-command` and `matlab-shell-command-switches` > In my case they are equal: `matlab` and ("-nodesktop"), > respectively, which is by default set in `matlab-shell.el` which is a > part of matlab-mode package. So it is in mine. Again, I use the matlab-shell very often but from .m files. I think I will start emacs -Q and load you configuration+minimal matlab conf and see what happens. I find in strange that in our case fprintf does not work. It works for me in the matlab-shell and using my (complicated) python engine solution 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. |
From: martinoidar <mar...@gm...> - 2024-04-22 17:35:49
|
On 22.04.2024 14:52, Uwe Brauer wrote: > 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 Well... 1. After installing matlab-support you should be able to Matlab from bash by typing the command >> matlab Can you do that? a) if yes Can you evoke matlab-shell in Emacs? (M-x matlab-shell) Again, you should be able to do that after installing matlab-mode. b) if no: check what are the values of the variables: `matlab-shell-command` and `matlab-shell-command-switches` In my case they are equal: `matlab` and ("-nodesktop"), respectively, which is by default set in `matlab-shell.el` which is a part of matlab-mode package. Maybe you need to set them explicitely like here: https://swang251.github.io/2021/12/03/Matlab-in-Emacs/ ??? |
From: Uwe B. <ou...@ma...> - 2024-04-22 12:52:56
|
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. |
From: martinoidar <mar...@gm...> - 2024-04-21 21:35:36
|
On 21.04.2024 19:40, Uwe Brauer wrote: > >> Well, I also prefer gitlab, especially after recent controversies with >> co-pilot >> (https://www.infoworld.com/article/3627319/github-copilot-is-unacceptable-and-unjust-says-free-software-foundation.html), >> though I'm not fervent about it... > > >> Yes, I do use org-babel and matlab. Until now, it hasn't been flawless >> experience but I manage to get the results back. >> But to be honest, I have no idea what mysterious mechanism enables me >> that. It's not been long since I've been using emacs, so there's still >> many lines in my init.el copied from here and there in a hope they >> will do... >> According to my notes I followed the instructions from here: >> https://gewhere.github.io/blog/2017/12/19/setup-matlab-in-emacs-and-babel-orgmode/ >> but nowwhen I inspect my init.el I can find only the code from the >> last section of above-mentioned page ("Setup MATLAB with babel >> orgmode"). >> Besides installing matlab-mode I have also manually downloaded: >> https://github.com/karthink/.emacs.d/blob/master/plugins/ob-octave-fix.el >> and included in init.el following the discussion found here: >> - https://www.reddit.com/r/emacs/comments/pufgce/matlab_mode/ >> - >> https://www.reddit.com/r/emacs/comments/fy98bs/orgbabels_matlab_session_output_is_malformed/ > >> ... and that's all... org-babel and matlab somehow work together and I >> try not to complain much... ;) > Thanks I will study this later. What I am most interested is > > 1. Execute matlab code in a org buffer (with the correct block around the matlab code. > > 2. Insert the result directly in the org buffer. > > Here in exchange is my method. > > 1. The python engine shipped by mathworks (warning different matlab > releases require different python versions, that is why I am > stuck at the moment with R2019A, which still support python 3.5. > > 2. ob-ipython > > Actually the following steps > > > > ** Python3 and matlab-kernel: HOWTO > sudo apt-get install python3-setuptools > sudo -H python3 -m pip install jupyter > sudo apt-get remove python3-pexpect > sudo -H python3 -m pip install pexpect > sudo -H python3 -m pip install matlab_kernel > ** Install the python API for matlab. > MATLABROOT=/usr/local/MATLAB/R2019a > Cd $MATLABROOT/extern/engines/python > sudo -H python3 setup.py install > ** Start the engine > Run > /usr/bin/python3 > in the python prompt: > import matlab.engine > eng = matlab.engine.start_matlab() > the eng command needs some time to run. > When finished run now > eng.quit() > > #+BEGIN_SRC emacs-lisp > (setq org-confirm-babel-evaluate nil) ;don't prompt me to confirm everytime I want to evaluate a block > ;;; display/update images in the buffer after I evaluate > (add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append) > > (add-to-list 'org-src-lang-modes '("matlab" . matlab)) > (setq python-shell-interpreter "python3") > ;; set default headers for convenience > (setq org-babel-default-header-args:matlab > '((:results . "output replace") > (:session . "matlab") > (:kernel . "matlab") > (:exports . "code") > (:cache . "no") > (:noweb . "no") > (:hlines . "no") > (:tangle . "no"))) > (defalias 'org-babel-execute:matlab 'org-babel-execute:ipython) > (defalias 'org-babel-prep-session:matlab 'org-babel-prep-session:ipython) > (defalias 'org-babel-matlab-initiate-session 'org-babel-ipython-initiate-session) > #+END_SRC > #+RESULTS: > : org-babel-matlab-initiate-session > Then use the following example > #+begin_src matlab :results output latex :exports results :eval never-export :wrap latex > x = [1, 2, 3, 4, 5]; > fprintf('|%d', x) > #+end_src > > #+RESULTS: > #+begin_latex > |1|2|3|4|5 > #+end_latex > > > Uwe > > 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 2. In Emacs: install `matlab-mode` package 3. Download https://github.com/karthink/.emacs.d/blob/master/plugins/ob-octave-fix.el 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) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I do remember that this 'ob-octave-fix' is very important. Otherwise there are some problems... This works with Emacs 29.1 and currently Matlab 2023b. The code you provided returned nothing in my case and in order to obtain the same result I needed to tailor it a bit (Should there really be a call to 'fprintf'?): #+begin_src matlab :results output latex :exports results :eval never-export :wrap latex x = [1, 2, 3, 4, 5] ; disp(sprintf('|%d', x)) #+end_src #+RESULTS: #+begin_latex |1|2|3|4|5 #+end_latex |