;ELC   
;;; Compiled
;;; in Emacs version 26.3
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(require 'ob)
(defvar org-babel-default-header-args:matlab nil)
(defvar org-babel-default-header-args:octave nil)
#@53 Shell command to run matlab as an external process.
(defvar org-babel-matlab-shell-command "matlab -nosplash" (#$ . 522))
#@53 Shell command to run octave as an external process.
(defvar org-babel-octave-shell-command "octave -q" (#$ . 650))
#@150 If non-nil use matlab-shell-run-region for session evaluation.
  This will use EmacsLink if (matlab-with-emacs-link) evaluates
  to a non-nil value.
(defvar org-babel-matlab-with-emacs-link nil (#$ . 772))
(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")
(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")
(defvar org-babel-octave-eoe-indicator "'org_babel_eoe'")
(defvar org-babel-octave-eoe-output "ans = org_babel_eoe")
#@62 Execute a block of matlab code with Babel.

(fn BODY PARAMS)
(defalias 'org-babel-execute:matlab #[514 "\300\301#\207" [org-babel-execute:octave matlab] 6 (#$ . 1456)])
#@80 Execute a block of octave code with Babel.

(fn BODY PARAMS &optional MATLABP)
(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)])
#@59 Prepare SESSION according to PARAMS.

(fn SESSION PARAMS)
(defalias 'org-babel-prep-session:matlab #[514 "\300\301#\207" [org-babel-prep-session:octave matlab] 6 (#$ . 2423)])
#@80 Return list of octave statements assigning the block's variables.

(fn PARAMS)
(defalias 'org-babel-variable-assignments:octave #[257 "\300\301\302!\"\207" [mapcar #[257 "\300\301@\302A!#\207" [format "%s=%s;" org-babel-octave-var-to-octave] 6 "\n\n(fn PAIR)"] org-babel--get-vars] 5 (#$ . 2607)])
(defalias 'org-babel-variable-assignments:matlab 'org-babel-variable-assignments:octave)
#@166 Convert an emacs-lisp value into an octave variable.
Converts an emacs-lisp variable into a string of octave code
specifying a variable of the same value.

(fn VAR)
(defalias 'org-babel-octave-var-to-octave #[257 "\211<\203 \300\301\302\211@<\203 \303\202 \304#\305Q\207\211;\203\" \306\307\"\207\306\310\"\207" ["[" mapconcat org-babel-octave-var-to-octave "; " "," "]" format "'%s'" "%s"] 6 (#$ . 3004)])
#@111 Prepare SESSION according to the header arguments specified in PARAMS.

(fn SESSION PARAMS &optional MATLABP)
(defalias 'org-babel-prep-session:octave #[770 "\301#\302!\303!\204 \304\305\"\210\306 \307\310\311\312\313!\314\"\315$\216rq\210\212\316\317\307\320\321\312\313!\322\"\323\324%\"\210,\210\207" [comint-input-filter org-babel-octave-initiate-session org-babel-variable-assignments:octave org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" match-data make-byte-code 0 "\301\300\302\"\207" vconcat vector [set-match-data evaporate] 3 #[257 "\300\207" [nil] 2 "\n\n(fn INPUT)"] mapc 257 "\301\210\211c\210\302\303\304\"\210\305\300!\207" [1 comint-send-input nil t org-babel-comint-wait-for-output] 4 "\n\n(fn VAR)"] 13 (#$ . 3424)])
#@180 Create a matlab inferior process buffer.
If there is not a current inferior-process-buffer in SESSION then
create.  Return the initialized session.

(fn &optional SESSION PARAMS)
(defalias 'org-babel-matlab-initiate-session #[512 "\300\301#\207" [org-babel-octave-initiate-session matlab] 6 (#$ . 4216)])
#@189 Create an octave inferior process buffer.
If there is not a current inferior-process-buffer in SESSION then
create.  Return the initialized session.

(fn &optional SESSION PARAMS MATLABP)
(defalias 'org-babel-octave-initiate-session #[768 "\211\203 \301\302!\210\202 \301\303\304\305#\204 \301\306!\210\307\230?\205t \206+ \211\203* \310\202+ \311\312!\2035 \211\202r \313 \314\315\316\317\320!\321\"\322$\216\203Q \204T \323 \210\202T \324 \210\325\326!\203a \327!\202l ;\203j \202l \327 !\210p)\262\262\207" [org-babel-matlab-with-emacs-link require matlab octave-inf nil noerror octave "none" "*Inferior Matlab*" "*Inferior Octave*" org-babel-comint-buffer-livep current-window-configuration make-byte-code 0 "\301\300!\207" vconcat vector [set-window-configuration] 2 matlab-shell run-octave rename-buffer bufferp buffer-name] 11 (#$ . 4530)])
#@269 Pass BODY to the octave process in SESSION.
If RESULT-TYPE equals `output' then return the outputs of the
statements in BODY, if RESULT-TYPE equals `value' then return the
value of the last statement in BODY, as elisp.

(fn SESSION BODY RESULT-TYPE &optional MATLABP)
(defalias 'org-babel-octave-evaluate #[1027 "\203 \300$\207\301#\207" [org-babel-octave-evaluate-session org-babel-octave-evaluate-external-process] 9 (#$ . 5400)])
#@77 Evaluate BODY in an external octave process.

(fn BODY RESULT-TYPE MATLABP)
(defalias 'org-babel-octave-evaluate-external-process #[771 "\211\203 \202	 	\303=\203 \304\"\202; \305=\203: \306\307!\304\310\n\311\312\"\311\312\"$\"\210\313!\262\202; \314\207" [org-babel-matlab-shell-command org-babel-octave-shell-command org-babel-octave-wrapper-method output org-babel-eval value org-babel-temp-file "octave-" format org-babel-process-file-name noquote org-babel-octave-import-elisp-from-file nil] 14 (#$ . 5848)])
#@76 Evaluate BODY in SESSION.

(fn SESSION BODY RESULT-TYPE &optional MATLABP)
(defalias 'org-babel-octave-evaluate-session #[1027 "\306\203	 \307\202\n \310!\306\311!\312=\203 \313\314D\315#\202Z \316=\203Y \203A 	\203A \317\n\320\321\"\320\321\"%\315P\202Z \313\314\317\320\321\"\320\321\"$D\315#\202Z \322\203\262 	\203\262 \323 \324\325\326\327\330!\331\"\332$\216\333\334!r\211q\210\324\325\335\327\330!\336\"\332$\216c\210\337\340\341\322\211\211\342&\210\343ed\"\210\344\345!\210\346!\203\250 \347\350!\210\202\233 *\340\262)\262\202f\351!\204\277 \352\353\"\210\354 \324\325\355\327\330!\356\"\357$\216rq\210\212\360\340C\324\361\362\327\330!\363\"\364\365%B\322\366\367p!!b\210`d{\262|\266c\210\370\322\371\"\210@b\210\212\372\373\203\202A!\322\371#\205!\372B\322\371#)\204.\374\367p!!\210\202\366\367p!!b\210\211c\210\203X\375\376\315\377\373\206G\340!#\242\"\203X\211\242\325\225\322O\240\210\201C \242B\")\266\202,\262\322\316=\203v\201D !\202\307\312=\203\306\203\236\201E \201F \340\201G \201H \201G \201I \"\"\"!A\202\266A\201E \201G \201H \201G \201I \"\"!\235A\262\313\201J \201E !\315#\202\307\322\207" [org-babel-octave-eoe-indicator org-babel-matlab-with-emacs-link org-babel-matlab-emacs-link-wrapper-method org-babel-octave-wrapper-method comint-input-filter comint-output-filter-functions org-babel-temp-file "matlab-" "octave-" "matlab-emacs-link-wait-signal-" output mapconcat org-babel-chomp "\n" value format org-babel-process-file-name noquote nil current-window-configuration make-byte-code 0 "\301\300!\207" vconcat vector [set-window-configuration] 2 generate-new-buffer " *temp*" "\301\300!\205	 \302\300!\207" [buffer-name kill-buffer] write-region "" ignored excl matlab-shell-run-region message "Waiting for Matlab Emacs Link" file-exists-p sit-for 0.01 org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" match-data "\301\300\302\"\207" [set-match-data evaporate] 3 #[257 "\300\207" [nil] 2 "\n\n(fn INPUT)"] 257 "\300\211\242P\240\207" [] 4 "\n\n(fn TEXT)" process-mark get-buffer-process comint-send-input t re-search-forward regexp-quote accept-process-output string-match replace-regexp-in-string "[\n]+" comint-last-input-end org-babel-octave-eoe-output comint-prompt-regexp split-string org-babel-octave-import-elisp-from-file reverse delq mapcar org-babel-strip-quotes org-trim identity] 17 (#$ . 6385)])
#@141 Import data from FILE-NAME.
This removes initial blank and comment lines and then calls
`org-babel-import-elisp-from-file'.

(fn FILE-NAME)
(defalias 'org-babel-octave-import-elisp-from-file #[257 "\300\301!\302\211\303\304\305!!\306\307\310\311\312!\313\"\314$\216r\211q\210\315!\210\316\317\302\320#\210e\211\262\321 \211\262W\2037 |\210)r\211q\210\322\302\211\302\307%\210*\266\323\324\"\207" [org-babel-temp-file "octave-matlab-" nil get-buffer-create generate-new-buffer-name " *temp file*" make-byte-code 0 "\301\300!\205	 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 insert-file-contents re-search-forward "^[ 	]*[^# 	]" t point-at-bol write-region org-babel-import-elisp-from-file (16)] 12 (#$ . 8862)])
(provide 'ob-octave)
