> For the complete documentation index, see [llms.txt](https://nelson-9.gitbook.io/nelson/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nelson-9.gitbook.io/nelson/markdown/en/julia_engine/jlrun.md).

# 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 subsequentjlrun calls.

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

The values of these variables are captured inoutvars.

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

```matlab
jlrun('a = b * c', 'b', 5, 'c', 10)
r = jlrun('d = a + c', 'd')
```

```matlab
jlrun(["a = 3","print(a)"])
```

```matlab
[R1, R2] = jlrun("a=b*c",["a","b"], 'b', 5, 'c', 10)
```

## 🔗 See also

[jlrunfile](/nelson/markdown/en/julia_engine/jlrunfile.md), [jlenv](/nelson/markdown/en/julia_engine/jlenv.md), [Julia types supported](/nelson/markdown/en/julia_engine/julia_types.md).

## 🕔 History

| Version | 📄 Description  |
| ------- | --------------- |
| 1.12.0  | initial version |
