;ELC   
;;; Compiled
;;; in Emacs version 24.5.1
;;; 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" (#$ . 524))
#@53 Shell command to run octave as an external process.
(defvar org-babel-octave-shell-command "octave -q" (#$ . 652))
#@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 (#$ . 774))
(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")
#@44 Execute a block of matlab code with Babel.
(defalias 'org-babel-execute:matlab #[(body params) "\302	\303#\207" [body params org-babel-execute:octave matlab] 4 (#$ . 1458)])
#@44 Execute a block of octave code with Babel.
(defalias 'org-babel-execute:octave #[(body params &optional matlabp) "\306\307\310\203 \311\202\f \312\"!\313\314	\"A	\"\315\316\317	\320\"\"\313\321	\"A\313\322	\"A\313\323	\"A%\324&	\325	!#'\326\327\330\217(\331\n(\203X \332\333\334'\307\335(\"E\336#\202Z '$)(?\205\201 \337)\340\313\341	\"A\313\342	\"A\"\340\313\343	\"A\313\344	\"A\"#.\207" [matlabp params session vars result-params result-type intern format "org-babel-%s-initiate-session" "matlab" "octave" assoc :session mapcar cdr org-babel-get-header :var :result-params :result-type :file org-babel-expand-body:generic org-babel-variable-assignments:octave nil (org-babel-graphical-output-file params) ((error)) 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 out-file body full-body gfx-file result] 9 (#$ . 1639)])
#@38 Prepare SESSION according to PARAMS.
(defalias 'org-babel-prep-session:matlab #[(session params) "\302	\303#\207" [session params org-babel-prep-session:octave matlab] 4 (#$ . 2649)])
#@67 Return list of octave statements assigning the block's variables.
(defalias 'org-babel-variable-assignments:octave #[(params) "\301\302\301\303\304\305\"\"\"\207" [params mapcar #[(pair) "\301\302@\303A!#\207" [pair format "%s=%s;" org-babel-octave-var-to-octave] 5] cdr org-babel-get-header :var] 7 (#$ . 2840)])
(defalias 'org-babel-variable-assignments:matlab 'org-babel-variable-assignments:octave)
#@156 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.
(defalias 'org-babel-octave-var-to-octave #[(var) "<\203 \301\302\303\211@<\203 \304\202 \305#\306Q\207;\203\" \307\310\"\207\307\311\"\207" [var "[" mapconcat org-babel-octave-var-to-octave "; " "," "]" format "'%s'" "%s"] 5 (#$ . 3253)])
#@72 Prepare SESSION according to the header arguments specified in PARAMS.
(defalias 'org-babel-prep-session:octave #[(session params &optional matlabp) "\306	\n#\307	!\310!\204 \311\312\"\210\313 \314\216rq\210\315\316\317\"\210,*\207" [session params matlabp var-lines save-match-data-internal 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 ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) #[(input) "\300\207" [nil] 1] mapc #[(var) "\302\210c\210\303\304\305\"\210\306	!\207" [var session 1 comint-send-input nil t org-babel-comint-wait-for-output] 3]] 4 (#$ . 3662)])
#@149 Create a matlab inferior process buffer.
If there is not a current inferior-process-buffer in SESSION then
create.  Return the initialized session.
(defalias 'org-babel-matlab-initiate-session #[(&optional session params) "\302	\303#\207" [session params org-babel-octave-initiate-session matlab] 4 (#$ . 4424)])
#@150 Create an octave inferior process buffer.
If there is not a current inferior-process-buffer in SESSION then
create.  Return the initialized session.
(defalias 'org-babel-octave-initiate-session #[(&optional session params matlabp) "\203 \304\305!\210\202 \304\306\307\310#\204 \304\311!\210	\312\230?\205i 	\206+ \203* \313\202+ \314\315	!\2036 	\202h \316 \317\216\203I \204L \320 \210\202L \321 \210\322\323	!\203Y \324	!\202d 	;\203b 	\202d \324 !\210p*)\207" [matlabp session #1=#:wconfig 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 ((set-window-configuration #1#)) matlab-shell run-octave rename-buffer bufferp buffer-name] 4 (#$ . 4745)])
#@218 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.
(defalias 'org-babel-octave-evaluate #[(session body result-type &optional matlabp) "\203 \304	\n$\207\305	\n#\207" [session body result-type matlabp org-babel-octave-evaluate-session org-babel-octave-evaluate-external-process] 5 (#$ . 5546)])
#@46 Evaluate BODY in an external octave process.
(defalias 'org-babel-octave-evaluate-external-process #[(body result-type matlabp) "\203 	\202	 \n\306\f\307\"\203 \310\"\202< \306\f\311\"\205< \312\313!\310\314\315\316\"\315\316\"$\"\210\317!))\207" [matlabp org-babel-matlab-shell-command org-babel-octave-shell-command cmd result-type body eql output org-babel-eval value org-babel-temp-file "octave-" format org-babel-process-file-name noquote org-babel-octave-import-elisp-from-file tmp-file org-babel-octave-wrapper-method] 9 (#$ . 6018)])
#@27 Evaluate BODY in SESSION.
(defalias 'org-babel-octave-evaluate-session #[(session body result-type &optional matlabp) "\306\203	 \307\202\n \310!\306\311!\312\313\"\203! \314\315\fD\316#\202W \312\317\"\205W \203D =\203D \320>\f\321	\322\"\321	\322\"\n%\316P\202W \314\315\320?\f\321	\322\"\321	\322\"$D\316#@\203\236 =\203\236 \323 A\324\216\325\326!BrBq\210\327\216@c\210\330\331\332\n\333\211\211\334&\210\335ed\"\210\336\337!\210\340\n!\203\231 \341\342!\210\202\214 -\331\202I\343C!\204\253 \344\345C\"\210\346 D\347\216rCq\210\350E\331F\351GBG\333\211HI\352\353p!!b\210`dJ\211KJ{HKJ|\210*@c\210\354\333\355\"\210Lb\210\212\356\357\203\372 \202\374 M!\333\355#\205	\356N\333\355#)\204\360\353p!!\210\202\353 \352\353p!!b\210Hc\210@\203A\361\362\316\363\357@\2061\331!#F\"\203AF\364\225\333OI\365FN\".I\333O\312\317\"\203[\366	!\202\217\312\313\"\205\217\203w\367\370\331\371\372\371\373I\"\"\"!A\202\205M\367\371\372\371\373I\"\"!\235AO\314\374\367O!\316#-\207" [matlabp tmp-file wait-file result-type body org-babel-octave-eoe-indicator org-babel-temp-file "matlab-" "octave-" "matlab-emacs-link-wait-signal-" eql output mapconcat org-babel-chomp "\n" value format org-babel-process-file-name noquote current-window-configuration ((set-window-configuration #1=#:wconfig)) generate-new-buffer " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#2=#:temp-buffer buffer-name kill-buffer] 2)) write-region "" ignored nil 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 ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) #[(input) "\300\207" [nil] 1] #[(text) "	P\211\207" [string-buffer text] 2] process-mark get-buffer-process comint-send-input t re-search-forward regexp-quote accept-process-output string-match replace-regexp-in-string "[\n]+" 0 split-string org-babel-octave-import-elisp-from-file reverse delq mapcar org-babel-octave-read-string org-babel-trim identity org-babel-matlab-with-emacs-link org-babel-matlab-emacs-link-wrapper-method org-babel-octave-wrapper-method full-body #1# #2# session save-match-data-internal comint-input-filter string-buffer comint-output-filter-functions dangling-text raw end start comint-last-input-end org-babel-octave-eoe-output comint-prompt-regexp results] 10 (#$ . 6584)])
#@125 Import data from FILE-NAME.
This removes initial blank and comment lines and then calls
`org-babel-import-elisp-from-file'.
(defalias 'org-babel-octave-import-elisp-from-file #[(file-name) "\306\307!\310\211\211\311\312\313!!\314\216rq\210\315!\210\316\317\310\320#\210e\211\321 \211W\203/ 	|\210)rq\210\322\310\211\f\310\323%\210,\324\n\325\"+\207" [end beg temp-file #1=#:temp-buffer #2=#:temp-file file-name org-babel-temp-file "octave-matlab-" nil get-buffer-create generate-new-buffer-name " *temp file*" ((byte-code "\301!\203\n \302!\210\301\207" [#1# buffer-name kill-buffer] 2)) insert-file-contents re-search-forward "^[ 	]*[^# 	]" t point-at-bol write-region 0 org-babel-import-elisp-from-file (16)] 7 (#$ . 9073)])
#@38 Strip \"s from around octave string.
(defalias 'org-babel-octave-read-string #[(string) "\301\302\"\203\f \303\304\"\207\207" [string string-match "^\"\\([^ ]+\\)\"$" match-string 1] 3 (#$ . 9819)])
(provide 'ob-octave)
