jlrun

Run Julia statements from Nelson.

Syntax

  • jlrun(code)

  • outvars = jlrun(code, outputs)

  • outvars = jlrun(code, outputs, jlName, jlValue)

Input argument

  • code - a string scalar, string array, character vector, character array.

  • jlName, jlValue - Input arguments name and value

  • outputs - string array: Julia variable names.

Output argument

  • outvars - One or more Nelson workspace variable names returned as valid Julia types.

Description

jlrun(code) function executes Julia statements present in the code string within the Julia interpreter.

Variables generated by the jlrun function remain persistent, allowing their usage in subsequent jlrun calls.

outvars = jlrun(code, outputs) Julia variables specified in outputs are returned to Nelson.

The values of these variables are captured in outvars.

outvars = jlrun(code, outputs, jlName, jlValue), the code is executed with assigned input and output variable names using Nelson data passed through one or more name-value arguments.

Examples

jlrun('a = b * c', 'b', 5, 'c', 10)
r = jlrun('d = a + c', 'd')
jlrun(["a = 3","print(a)"])
[R1, R2] = jlrun("a=b*c",["a","b"], 'b', 5, 'c', 10)

See also

jlrunfile, jlenv, Julia types supported.

History

Version
Description

1.12.0

initial version

Author

Allan CORNET

Last updated

Was this helpful?