Python / MATLAB external computation
Run your own Python or MATLAB script on Lattiro channels and keep its outputs as calculated channels.
Where to find it
- Navigation → Calculations → + New → Formula → External scripts → Python / MATLAB external computation
Steps
- 1
Choose the runtime
In External computation, set Runtime to Python or MATLAB. Under Executable, click Select executable… and choose the local Python 3, or MATLAB's bin/matlab.
- 2
Pick the script and inputs
Under Calculation script, click Select script… and choose a .py or .m file. Tick up to 8 input channels and enter Start / s and End / s under Time range.
- 3
Run and preview
Click Run & preview. Result preview shows each output's curve, valid samples and range; Run diagnostics shows what the script wrote to stderr. Cancel stops a run.
- 4
Keep the results
Untick outputs you do not need and click Keep selected results as calculated channels. Open a kept result and click Add to plot, or use Show in….
Good to know
Python
Lattiro passes JSON on stdin and reads the result JSON from stdout. Python runs in isolated mode, so PYTHONPATH and user site-packages are ignored: install packages into the chosen interpreter or its virtual environment.
MATLAB
Lattiro calls the function with the same name as the .m file through -batch. A full MATLAB installation and a valid licence are needed; MATLAB figure windows are not shown in Lattiro.
Limits
Up to 8 input channels, 100,000 samples, 1–8 outputs, 120 seconds per run and a 1 MiB script. Script protocol & limits shows the details.
Results do not update by themselves
Kept results are the output of that run. Run the script again after the data, formulas or settings change.
Units first
If an input's unit or scale is not confirmed, fix it in Channel management → Correction before running the script.