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
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Uwe B. <ou...@ma...> - 2019-02-20 09:40:22
|
>>> "VN" == Vladimir Nikishkin <loc...@gm...> writes: > Hello, everyone > I wanted to install matlab-mode on windows, but the INSTALL file is a > bit confusing. > Firstly, I don't have a standard `make' on Windows, and I don't know > which one would work best. (I guess, the one with which Emacs itself > is built on Windows, but I don't know exactly how this is done.) > Secondly, I tried to just simply copy the source to > .emacs.d/elpa/matlab-mode/, Why do you do this???? Why don't you use the package manager and install it in clean way? |
From: Uwe B. <ou...@ma...> - 2019-02-20 09:40:05
|
>>> "VN" == Vladimir Nikishkin <loc...@gm...> writes: > Simple answer: I don't have an internet access on this machine. But you do have access to the source code in sourceforge? That is really odd. Unfortunately I am on Linux, so I don't have experience with make on windows. You might try to install cygwin, if you have access to that site, of course. |
From: Vladimir N. <loc...@gm...> - 2019-02-20 09:23:04
|
Simple answer: I don't have an internet access on this machine. Uwe Brauer <ou...@ma...> 于 2019年2月20日周三 17:13写道: > >>> "VN" == Vladimir Nikishkin <loc...@gm...> writes: > > > Hello, everyone > > I wanted to install matlab-mode on windows, but the INSTALL file is a > > bit confusing. > > > Firstly, I don't have a standard `make' on Windows, and I don't know > > which one would work best. (I guess, the one with which Emacs itself > > is built on Windows, but I don't know exactly how this is done.) > > > Secondly, I tried to just simply copy the source to > > .emacs.d/elpa/matlab-mode/, > > Why do you do this???? > > Why don't you use the package manager and install it in clean way? > |
From: Vladimir N. <loc...@gm...> - 2019-02-20 07:48:03
|
Hello, everyone I wanted to install matlab-mode on windows, but the INSTALL file is a bit confusing. Firstly, I don't have a standard `make' on Windows, and I don't know which one would work best. (I guess, the one with which Emacs itself is built on Windows, but I don't know exactly how this is done.) Secondly, I tried to just simply copy the source to .emacs.d/elpa/matlab-mode/, add it to the 'package-selected-packages variable in .emacs and issue (require 'matlab-load), but it still doesn't work Perhaps, matlab-load is only created during the build process? Can someone help me with this? I'm using Emacs 26.1 -- Yours sincerely, Vladimir Nikishkin |
From: W. R. L. <wry...@gm...> - 2019-02-16 13:29:35
|
Hi all, I've been playing with using flycheck to highlight MLINT warnings/errors rather than the existing code in mlint.el. flycheck is a popular and robust package for code checkers and it would be great to support in matlab-mode. So I'm writing to propose adding it to the matlab.el distribution. The code I've been using is at the end of this message. Some open questions I have: 1. What's the best way to integrate with matlab-mode? Right now I just turn off the current mlint highlighting in the setup function: (defun flycheck-matlab-mlint-setup () "Set up Flycheck MATLAB mlint. Adds `matlab-mlint' to `flycheck-checkers'. NOTE: This disables showing warnings with the matlab-mode mlint integration" (interactive) (add-to-list 'flycheck-checkers 'matlab-mlint) (eval-after-load 'matlab '(setq matlab-show-mlint-warnings nil))) 2. How could we integrate this with the mlint.el heuristics for finding the mlint executable? Right now a user has to set flycheck-matlab-mlint-executable. Maybe this could be more automated. Aside from that, I've really liked flycheck integration as it provides many niceties and will continue to provide more as the underlying infrastructure evolves. Thanks, Ryan Code: ;;; flycheck-matlab-mlint.el --- Flycheck: MATLAB support -*- lexical-binding: t; -*- ;;; Commentary: ;; Provides support for MATLAB code checking with mlint and flycheck ;; that integrates with matlab-mode ;; ;; Usage: ;; ;; (eval-after-load 'flycheck ;; '(add-hook 'flycheck-mode-hook #'flycheck-matlab-mlint-setup)) ;;; Code: (require 'flycheck) (flycheck-define-checker matlab-mlint "A MATLAB checker using MATLAB mlint" :command ("mlint" "-id" "-all" source-original) ;; Example mlint messages. ;; L 588 (C 46-49): LOAD: To avoid conflicts with functions on the path, specify variables to load from file. ((warning line-start "L " line " (C " column "-" column "): " (id (* alnum)) ":" (message)) (warning line-start "L " line " (C " column "): " (id (* alnum)) ":" (message)) ) :modes (matlab-mode) :predicate (lambda () (flycheck-buffer-saved-p))) ;;;###autoload (defun flycheck-matlab-mlint-setup () "Set up Flycheck MATLAB mlint. Adds `matlab-mlint' to `flycheck-checkers'. NOTE: This disables showing warnings with the matlab-mode mlint integration" (interactive) (add-to-list 'flycheck-checkers 'matlab-mlint) (eval-after-load 'matlab '(setq matlab-show-mlint-warnings nil))) (provide 'flycheck-matlab-mlint) ;;; flycheck-matlab-mlint.el ends here |
From: Ondra K. <ond...@gm...> - 2019-01-30 08:43:33
|
Dear all, the reported problem does not seem to concern matlab-shell at all. So my email can be ignored here. I found out the similar problem happens in 2018b but for legend command when run in matlab-shell, and then I found out that this problem is also in 2018a if run from terminal. It does not depend on matlab-shell in emacs. It seems to depend on the order i ran different versions of Matlab. It rather seems that the problem might be connected with three Matlab installations, so i will investigate. Maybe my ~/pathdef.m is not loading all the paths because it gets overwritten by another matlab? Anyway, i apologize for disturbing a wrong list. 0. On Tue, Jan 29, 2019 at 7:00 PM Ondra Kamenik <ond...@gm...> wrote: > Dear all, > > matlab-mode.el is great! I have been using it for years with great > satisfaction. Thank you for your work. > > I installed today 2018a and also 2018b. My previous version was 2015b. If > I run matlab in Emacs matlab-shell-mode than I get the following error when > calling "system('ls')" for example: > > >> format compact > >> system('ls') > Undefined variable "matlab" or class > "matlab.io.internal.utility.convertStringsToChars". > Error in dos (line 65) > [varargin{1:nargin}] = > matlab.io.internal.utility.convertStringsToChars(varargin{:}); > >> usejava('jvm') > ans = > logical > 1 > >> ver('MATLAB') > > ----------------------------------------------------------------------------------------------------- > MATLAB Version: 9.4.0.813654 (R2018a) > MATLAB License Number: 40706422 > Operating System: Linux 4.19.13-300.fc29.x86_64 #1 SMP Sat Dec 29 22:54:28 > UTC 2018 x86_64 > Java Version: Java 1.8.0_144-b01 with Oracle Corporation Java HotSpot(TM) > 64-Bit Server VM mixed mode > > ----------------------------------------------------------------------------------------------------- > MATLAB Version 9.4 > (R2018a) > > If I run the same in matlab-shell for R2018b, i don't have any problem. If > i run matlab 2018a from terminal with "-nodesktop", i don't have any > problem either. The only problem is a combination of 2018a and > matlab-shell. I checked outputs of matlab -n and matlab -e run from > terminal and from matlab-shell, but i did not find any difference which > could cause it. > > Many thanks for any leaders. Unfortunately, i cannot replace 2018a with > 2018b as we have a lot of codes which still need be ported to 2018b. > > 0. > |
From: Ondra K. <ond...@gm...> - 2019-01-29 18:00:25
|
Dear all, matlab-mode.el is great! I have been using it for years with great satisfaction. Thank you for your work. I installed today 2018a and also 2018b. My previous version was 2015b. If I run matlab in Emacs matlab-shell-mode than I get the following error when calling "system('ls')" for example: >> format compact >> system('ls') Undefined variable "matlab" or class "matlab.io.internal.utility.convertStringsToChars". Error in dos (line 65) [varargin{1:nargin}] = matlab.io.internal.utility.convertStringsToChars(varargin{:}); >> usejava('jvm') ans = logical 1 >> ver('MATLAB') ----------------------------------------------------------------------------------------------------- MATLAB Version: 9.4.0.813654 (R2018a) MATLAB License Number: 40706422 Operating System: Linux 4.19.13-300.fc29.x86_64 #1 SMP Sat Dec 29 22:54:28 UTC 2018 x86_64 Java Version: Java 1.8.0_144-b01 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode ----------------------------------------------------------------------------------------------------- MATLAB Version 9.4 (R2018a) If I run the same in matlab-shell for R2018b, i don't have any problem. If i run matlab 2018a from terminal with "-nodesktop", i don't have any problem either. The only problem is a combination of 2018a and matlab-shell. I checked outputs of matlab -n and matlab -e run from terminal and from matlab-shell, but i did not find any difference which could cause it. Many thanks for any leaders. Unfortunately, i cannot replace 2018a with 2018b as we have a lot of codes which still need be ported to 2018b. 0. |
From: Eric L. <Eri...@ma...> - 2018-10-25 12:44:27
|
I tried the case with: % foobar 1 and it font-locked ok for me. The comment/string highlighter won't highlight areas that are already highlighted by something else. Do you have any other font-lock trickery going on that might be highlighting numbers before the matlab lockers start up? Eric From: ole petter orhagen <ol...@ho...> Sent: Wednesday, October 24, 2018 12:18 PM To: mat...@li... Subject: Re: [Matlab-emacs-discuss] Font-lock breakage? lol, looking a little closer at emacs regexps it seems this should match numerals. Then I'm afraid I'm out of ideas on how to fix this in a nippy ________________________________ Fra: ole petter orhagen <ol...@ho...<mailto:ol...@ho...>> Sendt: onsdag 24. oktober 2018 18.14.41 Til: mat...@li...<mailto:mat...@li...> Emne: Re: [Matlab-emacs-discuss] Font-lock breakage? ________________________________ Fra: ole petter orhagen <ol...@ho...<mailto:ol...@ho...>> Sendt: onsdag 24. oktober 2018 18.04 Til: mat...@li...<mailto:mat...@li...> Emne: Font-lock breakage? Hi, It seems to me that font-locking is somewhat broken. I might be wrong however. The issue seems to be: % foobar Works just fine % foobar1 Also works However % foobar 1 or any other number for that matter - will break font-locking. However, looking at the function 'matlab-font-lock-comment-match', and the regex '\\(%[^%\n]*\\)', this will not match numerals. Is this a conscious design decition? Cheers -O |
From: ole p. o. <ol...@ho...> - 2018-10-24 16:17:52
|
lol, looking a little closer at emacs regexps it seems this should match numerals. Then I'm afraid I'm out of ideas on how to fix this in a nippy ________________________________ Fra: ole petter orhagen <ol...@ho...> Sendt: onsdag 24. oktober 2018 18.14.41 Til: mat...@li... Emne: Re: [Matlab-emacs-discuss] Font-lock breakage? ________________________________ Fra: ole petter orhagen <ol...@ho...> Sendt: onsdag 24. oktober 2018 18.04 Til: mat...@li... Emne: Font-lock breakage? Hi, It seems to me that font-locking is somewhat broken. I might be wrong however. The issue seems to be: % foobar Works just fine % foobar1 Also works However % foobar 1 or any other number for that matter - will break font-locking. However, looking at the function 'matlab-font-lock-comment-match', and the regex '\\(%[^%\n]*\\)', this will not match numerals. Is this a conscious design decition? Cheers -O |
From: ole p. o. <ol...@ho...> - 2018-10-24 16:14:52
|
________________________________ Fra: ole petter orhagen <ol...@ho...> Sendt: onsdag 24. oktober 2018 18.04 Til: mat...@li... Emne: Font-lock breakage? Hi, It seems to me that font-locking is somewhat broken. I might be wrong however. The issue seems to be: % foobar Works just fine % foobar1 Also works However % foobar 1 or any other number for that matter - will break font-locking. However, looking at the function 'matlab-font-lock-comment-match', and the regex '\\(%[^%\n]*\\)', this will not match numerals. Is this a conscious design decition? Cheers -O |
From: Eric L. <Eri...@ma...> - 2018-10-01 12:24:49
|
Thanks Uwe! Eric -----Original Message----- From: Uwe Brauer <ou...@ma...> Sent: Saturday, September 29, 2018 9:53 AM To: Eric Ludlam <Eri...@ma...> Cc: mat...@li... Subject: Re: [Matlab-emacs-discuss] Patch for matlab.el to support string >>> "Eric" == Eric Ludlam <Eri...@ma...> writes: > The attached patch adds support for Strings in matlab-mode. Applied to the sf and github repo. Thanks Eric |
From: Uwe B. <ou...@ma...> - 2018-09-29 14:20:18
|
>>> "Eric" == Eric Ludlam <Eri...@ma...> writes: > The attached patch adds support for Strings in matlab-mode. Applied to the sf and github repo. Thanks Eric |
From: Eric L. <Eri...@ma...> - 2018-09-28 13:27:43
|
The attached patch adds support for Strings in matlab-mode. Previously, character vectors such as: a = 'char vector' a = 'char '' vector' were supported. This patch enables b = "string scalar" b = "string "" scalar" to also be highlighted. There is one bug remaining which is that: a = 'unterminated '' string used to work, but now fails for char vector and string. Unterminated strings still work for: a = 'unterminated string cases where there is no '' or "" in the string. Enjoy Eric |
From: Uwe B. <ou...@ma...> - 2018-08-11 09:03:44
|
>>> "LS" == LS CRT Sekretariat <k.s...@b-...> writes: > Hi > executing the matlab code (see below) > #+begin_src matlab :session :results output > clear > a=1; > i=1 > #+end_src > #+RESULTS: > : clear > : a=1; > : i=1 > : > : i = > : > : 1 > the code is copied into the results buffer, which is not what I want. > Using octave instead of matlab will yield the correct output from stdout. > Any hint or help is greatly appreciated. Hi The syntax you are using, seems to me a question to org mode, not to matlab mode. Emacs matlab mode provides a mayor mode for .m files for editing it also provides a command shell written in lisp which allows you to display the results in a separate buffer, precisely what you are looking for. But it is different mayor mode. I asked some time ago the inverse question, I wanted to use the lisp matlab shell in org mode, since I wanted to *insert* the result of the matlab calculations in the same mode I have the matlab commands. You want the opposite. So either, 1. Use the matlab emacs mode. 2. Ask in the org mode list. Or what do I miss? Uwe Brauer |
From: LS C. S. <k.s...@b-...> - 2018-08-10 08:53:53
|
Hi executing the matlab code (see below) #+begin_src matlab :session :results output clear a=1; i=1 #+end_src #+RESULTS: : clear : a=1; : i=1 : : i = : : 1 the code is copied into the results buffer, which is not what I want. Using octave instead of matlab will yield the correct output from stdout. Any hint or help is greatly appreciated. Kind regards Klaus |
From: Uwe B. <ou...@ma...> - 2018-07-03 16:03:58
|
>>> "Eric" == Eric Ludlam <Eri...@ma...> writes: Hi Eric > Hi Uwe, Thanks for your answer. > I did see this on the list the first time, and I spent a little > time on it. I was surprised to see the result from using > matlab-shell-collect-command-output cropping as you suggested. > There are a few filters for things like errors, anchors, and other > misc text to hide that I played with, but I found nothing that > matched \end at that time so I didn't end up replying as I hadn't > found anything. There may be something else with the special MATLAB > end keyword I missed. Process filters are a challenge to debug, > particularly when there is both the matlab filter plus the gud > filter interacting which I'm just not that familiar with anymore. > If you start in gud-matlab-marker-filter, you can see some of the > stuff it filters, such as escape codes, error, opentoline, etc. > Anyway, I didn't see anything there. > matlab-shell-collect-command-output perhaps could cheat, and > disable the process filter near the loop that accepts process > output. For example: > (condition-case nil > (set-process-filter (get-buffer-process (current-buffer)) > nil) > ;; loop is here > (error nil)) > (set-process-filter (get-buffer-process (current-buffer)) > 'gud-filter) Do you suggest, that I should give this modification a try? Meanwhile I got the python jupyther client, matlab kernel and emacs ob-ipython to work. This is much faster than John's solution but slower than the emacs lisp shell!! > but that's a pretty big hammer. I guess it would tell us if the > filter is the problem. If it is in this loop, there may be an issue > in prompt detection. The bit that cuts out the string to return is > pretty simple. Perhaps it is being confused by newlines or > something. Maybe in my vacation I will play around a bit. There seems not much interest in the matlab list nor in the org mailing list about this issue though. Regards Uwe |
From: Eric L. <Eri...@ma...> - 2018-07-02 13:10:39
|
Hi Uwe, I did see this on the list the first time, and I spent a little time on it. I was surprised to see the result from using matlab-shell-collect-command-output cropping as you suggested. There are a few filters for things like errors, anchors, and other misc text to hide that I played with, but I found nothing that matched \end at that time so I didn't end up replying as I hadn't found anything. There may be something else with the special MATLAB end keyword I missed. Process filters are a challenge to debug, particularly when there is both the matlab filter plus the gud filter interacting which I'm just not that familiar with anymore. If you start in gud-matlab-marker-filter, you can see some of the stuff it filters, such as escape codes, error, opentoline, etc. Anyway, I didn't see anything there. matlab-shell-collect-command-output perhaps could cheat, and disable the process filter near the loop that accepts process output. For example: (condition-case nil (set-process-filter (get-buffer-process (current-buffer)) nil) ;; loop is here (error nil)) (set-process-filter (get-buffer-process (current-buffer)) 'gud-filter) but that's a pretty big hammer. I guess it would tell us if the filter is the problem. If it is in this loop, there may be an issue in prompt detection. The bit that cuts out the string to return is pretty simple. Perhaps it is being confused by newlines or something. Eric -----Original Message----- From: Uwe Brauer [mailto:ou...@ma...] Sent: Monday, July 02, 2018 4:45 AM To: matlab-emacs-discuss <mat...@li...> Cc: John Ciolfi <Joh...@ma...>; Eric Ludlam <eri...@gm...> Subject: [Matlab-emacs-discuss] org mode: execute matlab code and insert it, the matlab shell, matlab live editor, jupiter notebook Hi I am not sure whether this mail made to the list, I never saw it. I also cc this message to John and Eric since they might know more about the matlab shell. One of new features in matlab is the matlab live editor, which allows to mix documentation, matlab code and, most importantly, the results of executed matlab code. It seems that the jupiter notebooks should have a similar feature, but I have not tried it out. The question is whether there is a similar solution using emacs. And the answer to this is yes, but it is, at the moment, quite slow, at least with recent matlab releases. The point is to use org mode. Org mode is a mayor mode which becomes increasing popular since it ships with an amazing amount of features. One of them is to execute code and insert the result in the org buffer, formatted if wished. Now matlab is not really supported natively, but John Kitchin posted a while ago a nice solution on the org mailing list. (defun org-babel-execute:matlab-john-org (body params) (interactive "P") (let* ((current-file (buffer-file-name)) (code (org-element-property :value (org-element-context))) (result-params (cdr (assoc :result-params params))) m-file md5-hash) (with-temp-buffer (insert code) (setq md5-hash (md5 (buffer-string)) mbuffer (format "*m-%s*" md5-hash) m-file (format "m-%s.m" md5-hash))) ;; create the file to run (with-temp-file m-file (insert code)) (let ((results (shell-command-to-string (concat "/usr/local/bin/matlab " "-nodesktop <" ; "-nodesktop -nojvm -nosplash -nodisplay <" ; "-nodesktop -nojvm -nosplash <" m-file)))) (delete-file m-file) (when results ;; strip out >> (setq results (replace-regexp-in-string ">> " "" results)) ;; remove first 10 lines that are the header. ;; matlab license seem to expire soon, so 5 warning lines are added ;; change first 10 to first 15 lines (setq results (mapconcat 'identity (nthcdr 10 (split-string results "\n")) "\n"))) (org-babel-result-cond result-params results)))) There is a problem with his code, however: It starts every time it is called the whole matlab engine, making it quite slow. So I thought of running the emacs matlab shell running and use it instead. So I came up with the following (defun org-babel-execute:matlab-john-shell (body params) (interactive "P") (let* ((current-file (buffer-file-name)) (code (org-element-property :value (org-element-context))) (result-params (cdr (assoc :result-params params)))) (let ((results (matlab-shell-collect-command-output code))) (org-babel-result-cond result-params results)))) That works, however take the following example #+begin_src matlab :results output latex :exports results :wrap latex X=[1,2,3,4,5,6,7]; p=[1/7 1/7 1/7 1/7 1/7 1/7 1/7]; E=X*p'; x2=X.*X; E2=x2*p'; V=E2-E^2; disp('\begin{align}') fprintf('E[X]&=%g\\\\ \n', E) fprintf('E^2[X]&=%g\\\\\n', E2) fprintf('V[X]&=%g\n', V) disp('\end{align}') disp('\end{align}') #+end_src By code only extracts: #+RESULTS: #+BEGIN_latex >> >> p=[1/7 1/7 1/7 1/7 1/7 1/7 1/7]; >> >> E=X*p'; >> >> x2=X.*X; \begin{align} E[X]&=4\\ E^2[X]&=20\\ V[X]&=4 #+END_latex But not the last 2 lines of the original matlab code. Anybody with a better know of the matlab-shell can explain that to me please? In order to test the code I should send a bunch of more functions, which I attach for convince. Regards Uwe Brauer |
From: Uwe B. <ou...@ma...> - 2018-07-02 09:12:36
|
Hi I am not sure whether this mail made to the list, I never saw it. I also cc this message to John and Eric since they might know more about the matlab shell. One of new features in matlab is the matlab live editor, which allows to mix documentation, matlab code and, most importantly, the results of executed matlab code. It seems that the jupiter notebooks should have a similar feature, but I have not tried it out. The question is whether there is a similar solution using emacs. And the answer to this is yes, but it is, at the moment, quite slow, at least with recent matlab releases. The point is to use org mode. Org mode is a mayor mode which becomes increasing popular since it ships with an amazing amount of features. One of them is to execute code and insert the result in the org buffer, formatted if wished. Now matlab is not really supported natively, but John Kitchin posted a while ago a nice solution on the org mailing list. (defun org-babel-execute:matlab-john-org (body params) (interactive "P") (let* ((current-file (buffer-file-name)) (code (org-element-property :value (org-element-context))) (result-params (cdr (assoc :result-params params))) m-file md5-hash) (with-temp-buffer (insert code) (setq md5-hash (md5 (buffer-string)) mbuffer (format "*m-%s*" md5-hash) m-file (format "m-%s.m" md5-hash))) ;; create the file to run (with-temp-file m-file (insert code)) (let ((results (shell-command-to-string (concat "/usr/local/bin/matlab " "-nodesktop <" ; "-nodesktop -nojvm -nosplash -nodisplay <" ; "-nodesktop -nojvm -nosplash <" m-file)))) (delete-file m-file) (when results ;; strip out >> (setq results (replace-regexp-in-string ">> " "" results)) ;; remove first 10 lines that are the header. ;; matlab license seem to expire soon, so 5 warning lines are added ;; change first 10 to first 15 lines (setq results (mapconcat 'identity (nthcdr 10 (split-string results "\n")) "\n"))) (org-babel-result-cond result-params results)))) There is a problem with his code, however: It starts every time it is called the whole matlab engine, making it quite slow. So I thought of running the emacs matlab shell running and use it instead. So I came up with the following (defun org-babel-execute:matlab-john-shell (body params) (interactive "P") (let* ((current-file (buffer-file-name)) (code (org-element-property :value (org-element-context))) (result-params (cdr (assoc :result-params params)))) (let ((results (matlab-shell-collect-command-output code))) (org-babel-result-cond result-params results)))) That works, however take the following example #+begin_src matlab :results output latex :exports results :wrap latex X=[1,2,3,4,5,6,7]; p=[1/7 1/7 1/7 1/7 1/7 1/7 1/7]; E=X*p'; x2=X.*X; E2=x2*p'; V=E2-E^2; disp('\begin{align}') fprintf('E[X]&=%g\\\\ \n', E) fprintf('E^2[X]&=%g\\\\\n', E2) fprintf('V[X]&=%g\n', V) disp('\end{align}') disp('\end{align}') #+end_src By code only extracts: #+RESULTS: #+BEGIN_latex >> >> p=[1/7 1/7 1/7 1/7 1/7 1/7 1/7]; >> >> E=X*p'; >> >> x2=X.*X; \begin{align} E[X]&=4\\ E^2[X]&=20\\ V[X]&=4 #+END_latex But not the last 2 lines of the original matlab code. Anybody with a better know of the matlab-shell can explain that to me please? In order to test the code I should send a bunch of more functions, which I attach for convince. Regards Uwe Brauer |
From: Uwe B. <ou...@ma...> - 2018-05-26 09:35:28
|
Hi Org mode is a mayor mode which becomes increasing popular since it ships with an amazing amount of features. One of them is to execute code and insert the result in the org buffer, formatted if wished. Now matlab is not really supported natively, but John Kitchin posted a while ago a nice solution on the org mailing list. (defun org-babel-execute:matlab-john-org (body params) (interactive "P") (let* ((current-file (buffer-file-name)) (code (org-element-property :value (org-element-context))) (result-params (cdr (assoc :result-params params))) m-file md5-hash) (with-temp-buffer (insert code) (setq md5-hash (md5 (buffer-string)) mbuffer (format "*m-%s*" md5-hash) m-file (format "m-%s.m" md5-hash))) ;; create the file to run (with-temp-file m-file (insert code)) (let ((results (shell-command-to-string (concat "/usr/local/bin/matlab " "-nodesktop <" ; "-nodesktop -nojvm -nosplash -nodisplay <" ; "-nodesktop -nojvm -nosplash <" m-file)))) (delete-file m-file) (when results ;; strip out >> (setq results (replace-regexp-in-string ">> " "" results)) ;; remove first 10 lines that are the header. ;; matlab license seem to expire soon, so 5 warning lines are added ;; change first 10 to first 15 lines (setq results (mapconcat 'identity (nthcdr 10 (split-string results "\n")) "\n"))) (org-babel-result-cond result-params results)))) There is a problem with his code, however: It starts every time it is called the whole matlab engine, making it quite slow. So I thought of running the emacs matlab shell running and use it instead. So I came up with the following (defun org-babel-execute:matlab-john-shell (body params) (interactive "P") (let* ((current-file (buffer-file-name)) (code (org-element-property :value (org-element-context))) (result-params (cdr (assoc :result-params params)))) (let ((results (matlab-shell-collect-command-output code))) (org-babel-result-cond result-params results)))) That works, however take the following example #+begin_src matlab :results output latex :exports results :wrap latex X=[1,2,3,4,5,6,7]; p=[1/7 1/7 1/7 1/7 1/7 1/7 1/7]; E=X*p'; x2=X.*X; E2=x2*p'; V=E2-E^2; disp('\begin{align}') fprintf('E[X]&=%g\\\\ \n', E) fprintf('E^2[X]&=%g\\\\\n', E2) fprintf('V[X]&=%g\n', V) disp('\end{align}') disp('\end{align}') #+end_src By code only extracts: #+RESULTS: #+BEGIN_latex >> p=[1/7 1/7 1/7 1/7 1/7 1/7 1/7]; >> E=X*p'; >> x2=X.*X; \begin{align} E[X]&=4\\ E^2[X]&=20\\ V[X]&=4 #+END_latex But not the last 2 lines of the original matlab code. Anybody with a better know of the matlab-shell can explain that to me please? In order to test the code I should send a bunch of more functions, which I attach for convince. Regards Uwe Brauer |
From: Uwe B. <ou...@ma...> - 2018-02-28 14:12:27
|
From: Uwe Brauer <ou...@ma...> Subject: To: matlab-emacs-discuss <mat...@li...> Date: Mon, 26 Feb 2018 10:19:21 +0100 (2 days, 4 hours, 51 minutes ago) Hi Please look at the following example attached, the function matlab-shell-run-cell exectued the code which is sourrounded by %{ disp('Code') %} While according to the documentation, this is a valid commented out region. Matlab internal editor respects the comment and does not execute it. So I presume we do not really support that sort of comments, do I have a deja-vu here? Did we discuss this already? Any comments? I just tested matlab-shell-run-region also execute the commented region. So the problem is deeper, then just the cell function. Uwe Brauer |
From: Uwe B. <ou...@ma...> - 2018-02-05 21:45:25
|
>>> "Eric" == Eric Ludlam <Eri...@ma...> writes: > John Ciolfi and I looked at your example. You are missing a close ]. > See the arrow I added below to your code snippet. Ah. You are right. That was the file with the mistake. I am really sorry and feel stupid. > I'm thinking that adding highlighting to keywords inside a [ ] block > might be a useful feature to make this more clear. Not sure how much > that would slow things down as detecting that is probably expensive. That would be helpful, but I can't judge the speed reduction. BTW I complained in another mail that 2016b and above is really slow on my machine. That is only true, if I start the whole beast. For emacs the change and the startup via no desktop, it is not notable. Sorry again.. Uwe |
From: Eric L. <Eri...@ma...> - 2018-02-05 21:41:31
|
John Ciolfi and I looked at your example. You are missing a close ]. See the arrow I added below to your code snippet. I'm thinking that adding highlighting to keywords inside a [ ] block might be a useful feature to make this more clear. Not sure how much that would slow things down as detecting that is probably expensive. Eric -----Original Message----- From: Uwe Brauer [mailto:ou...@ma...] Sent: Monday, February 05, 2018 4:23 PM To: Eric Ludlam <Eri...@ma...> Cc: Uwe Brauer <ou...@ma...>; matlab-emacs-discuss <mat...@li...> Subject: Re: [Matlab-emacs-discuss] indention stopped working? >>> "Eric" == Eric Ludlam <Eri...@ma...> writes: Hi Eric Thanks > Your examples work for me , but I don't have Emacs 27. I tried out Emacs 26, same problem, I deactivated any auto-fill function. > The only thing I can think of is some sort of auto-fill behavior is > going off, but that seems unlikely with just an indent-region. What is strange is the following If the file just contains for k=1:N+1 x(k+1)=x(k)+h; y(k+1)=f(x(k+1)); z(k+1)=g(x(k+1)); end Then indent-region does the right thing But if the file has f=@(x)[x*exp(-x)]; g=@(x)[exp(-x^2); <---------------- for k=1:N+1 x(k+1)=x(k)+h; y(k+1)=f(x(k+1)); z(k+1)=g(x(k+1)); end Then the indent-region function acts in a bizarre way. Can somebody please confirm this? |
From: Uwe B. <ou...@ma...> - 2018-02-05 21:23:12
|
>>> "Eric" == Eric Ludlam <Eri...@ma...> writes: Hi Eric Thanks > Your examples work for me , but I don't have Emacs 27. I tried out Emacs 26, same problem, I deactivated any auto-fill function. > The only thing I can think of is some sort of auto-fill behavior is > going off, but that seems unlikely with just an indent-region. What is strange is the following If the file just contains for k=1:N+1 x(k+1)=x(k)+h; y(k+1)=f(x(k+1)); z(k+1)=g(x(k+1)); end Then indent-region does the right thing But if the file has f=@(x)[x*exp(-x)]; g=@(x)[exp(-x^2); for k=1:N+1 x(k+1)=x(k)+h; y(k+1)=f(x(k+1)); z(k+1)=g(x(k+1)); end Then the indent-region function acts in a bizarre way. Can somebody please confirm this? |
From: Eric L. <Eri...@ma...> - 2018-02-05 13:45:41
|
Your examples work for me , but I don't have Emacs 27. The only thing I can think of is some sort of auto-fill behavior is going off, but that seems unlikely with just an indent-region. Eric -----Original Message----- From: Uwe Brauer [mailto:ou...@ma...] Sent: Saturday, February 03, 2018 10:29 AM To: matlab-emacs-discuss <mat...@li...> Subject: [Matlab-emacs-discuss] indention stopped working? Hi I swore this worked till recently: I have k=1:N+1 x(k+1)=x(k)+h; y(k+1)=f(x(k+1)); z(k+1)=g(x(k+1)); end So I mark it and run indent-region And I receive for k=1:N+1 x(k+1)=x(k)+h; y(k+1)=f(x(k+1)); z(k+1)=g(x(k+1)); end Which is absurd, I should have obtained for k=1:N+1 x(k+1)=x(k)+h; y(k+1)=f(x(k+1)); z(k+1)=g(x(k+1)); end Now I run matlab-indent-sexp And obtain again for k=1:N+1 x(k+1)=x(k)+h; y(k+1)=f(x(k+1)); z(k+1)=g(x(k+1)); end What is up here? Or is the culprit GNU emacs 27? Uwe Brauer ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Matlab-emacs-discuss mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss |
From: Uwe B. <ou...@ma...> - 2018-02-03 15:29:16
|
Hi I swore this worked till recently: I have k=1:N+1 x(k+1)=x(k)+h; y(k+1)=f(x(k+1)); z(k+1)=g(x(k+1)); end So I mark it and run indent-region And I receive for k=1:N+1 x(k+1)=x(k)+h; y(k+1)=f(x(k+1)); z(k+1)=g(x(k+1)); end Which is absurd, I should have obtained for k=1:N+1 x(k+1)=x(k)+h; y(k+1)=f(x(k+1)); z(k+1)=g(x(k+1)); end Now I run matlab-indent-sexp And obtain again for k=1:N+1 x(k+1)=x(k)+h; y(k+1)=f(x(k+1)); z(k+1)=g(x(k+1)); end What is up here? Or is the culprit GNU emacs 27? Uwe Brauer |