commit | author | age
|
76bbd0
|
1 |
;ELC |
C |
2 |
;;; Compiled |
|
3 |
;;; in Emacs version 26.1 |
|
4 |
;;; with all optimizations. |
|
5 |
|
|
6 |
;;; This file uses dynamic docstrings, first added in Emacs 19.29. |
|
7 |
|
|
8 |
;;; This file does not contain utf-8 non-ASCII characters, |
|
9 |
;;; and so can be loaded in Emacs versions earlier than 23. |
|
10 |
|
|
11 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
12 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
13 |
|
|
14 |
|
|
15 |
(require 'ob) |
|
16 |
(defvar org-babel-default-header-args:matlab nil) |
|
17 |
(defvar org-babel-default-header-args:octave nil) |
|
18 |
#@53 Shell command to run matlab as an external process. |
|
19 |
(defvar org-babel-matlab-shell-command "matlab -nosplash" (#$ . 522)) |
|
20 |
#@53 Shell command to run octave as an external process. |
|
21 |
(defvar org-babel-octave-shell-command "octave -q" (#$ . 650)) |
|
22 |
#@150 If non-nil use matlab-shell-run-region for session evaluation. |
|
23 |
This will use EmacsLink if (matlab-with-emacs-link) evaluates |
|
24 |
to a non-nil value. |
|
25 |
(defvar org-babel-matlab-with-emacs-link nil (#$ . 772)) |
|
26 |
(defvar org-babel-matlab-emacs-link-wrapper-method "%s\nif ischar(ans), fid = fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); fclose(fid);\nelse, save -ascii %s ans\nend\ndelete('%s')\n") |
|
27 |
(defvar org-babel-octave-wrapper-method "%s\nif ischar(ans), fid = fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); fclose(fid);\nelse, dlmwrite('%s', ans, '\\t')\nend") |
|
28 |
(defvar org-babel-octave-eoe-indicator "'org_babel_eoe'") |
|
29 |
(defvar org-babel-octave-eoe-output "ans = org_babel_eoe") |
|
30 |
#@62 Execute a block of matlab code with Babel. |
|
31 |
|
|
32 |
(fn BODY PARAMS) |
|
33 |
(defalias 'org-babel-execute:matlab #[514 "\300\301#\207" [org-babel-execute:octave matlab] 6 (#$ . 1456)]) |
|
34 |
#@80 Execute a block of octave code with Babel. |
|
35 |
|
|
36 |
(fn BODY PARAMS &optional MATLABP) |
|
37 |
(defalias 'org-babel-execute:octave #[770 "\300\301\302\203 \303\202\f \304\"!\305\236A\"\306\236A\307\310!#\3111+ \312!0\202- \210\313\314\203C \315\316\317\301\320\"E\321#\202D $?\205h \322\323\324\n\236A\325\236A\"\323\326\236A\327\f\236A\"#\207" [intern format "org-babel-%s-initiate-session" "matlab" "octave" :session :result-type org-babel-expand-body:generic org-babel-variable-assignments:octave (error) org-babel-graphical-output-file nil org-babel-octave-evaluate mapconcat identity "set (0, \"defaultfigurevisible\", \"off\");" "print -dpng %s" "\n" org-babel-reassemble-table org-babel-pick-name :colname-names :colnames :rowname-names :rownames] 16 (#$ . 1633)]) |
|
38 |
#@59 Prepare SESSION according to PARAMS. |
|
39 |
|
|
40 |
(fn SESSION PARAMS) |
|
41 |
(defalias 'org-babel-prep-session:matlab #[514 "\300\301#\207" [org-babel-prep-session:octave matlab] 6 (#$ . 2423)]) |
|
42 |
#@80 Return list of octave statements assigning the block's variables. |
|
43 |
|
|
44 |
(fn PARAMS) |
|
45 |
(defalias 'org-babel-variable-assignments:octave #[257 "\300\301\302!\"\207" [mapcar #[257 "\300\301@\302A!#\207" [format "%s=%s;" org-babel-octave-var-to-octave] 6 "\n\n(fn PAIR)"] org-babel--get-vars] 5 (#$ . 2607)]) |
|
46 |
(defalias 'org-babel-variable-assignments:matlab 'org-babel-variable-assignments:octave) |
|
47 |
#@166 Convert an emacs-lisp value into an octave variable. |
|
48 |
Converts an emacs-lisp variable into a string of octave code |
|
49 |
specifying a variable of the same value. |
|
50 |
|
|
51 |
(fn VAR) |
|
52 |
(defalias 'org-babel-octave-var-to-octave #[257 "\211<\203 \300\301\302\211@<\203 \303\202 \304#\305Q\207\211;\203\" |