Qu

matlab_exec

Builtin index · File I/O

result = matlab_exec(code, [vars=])

Input: code, vars · Output: result

What it is

The same contract as python_exec/js_exec, run through a local MATLAB installation instead: code's result is written to an injected qu_output_path variable (no leading underscore — MATLAB identifiers can't start with one) and the call returns the same {stdout, stderr, success, exit_code, result} record. Requires a working, licensed local MATLAB install; a failure (e.g. an expired license) does not panic — it comes back as success = false with MATLAB's own error text in stderr.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = matlab_exec(code, [vars=])
code —The same contract as python_exec/js_exec, run through a local MATLAB installation instead: code's result is written to an injected qu_output_path variable (no leading underscore — MATLAB identifiers can't start with one) and the call returns the same {stdout, stderr, success, exit_code, result} record.
vars optionalnot documented yet
stdout Stra Str
stderr Stra Str
success —a Bool
exit_code Numa Num
result —whatever the parsed JSON held, or none if MATLAB wrote no result
Returns a Record with fields stdout (a Str), stderr (a Str), success (a Bool), exit_code (a Num) and result (whatever the parsed JSON held, or none if MATLAB wrote no result).

Examples

No documentation example calls this form yet. The File I/O chapter is where one belongs.

How it works

Other inline languages share one implementation -- see deliberately excludes.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.