Diagram statements
block(...), connect(...), handle.method(...), plots and
figure verbs. They are read before the maths grammar, so their syntax is never taken for
arithmetic.
One prompt that reads MATLAB's syntax and replies like a Python REPL. It does maths over matrices and transfer functions, builds the diagram on the canvas and runs the named commands. The same engine answers in the Quick Code panel, in the ICore Script IDE and headless, from a build script.
>>>x = 3; y = x*[1 2; 3 4]; ymaths
y = [[3, 6], [9, 12]] # Matrix of Double>>>[1 2 3] >= 2logical
[[0, 1, 1]] # Matrix of Logical>>>v = [3 4 5]; v(end - 1)index
4 # Integer>>>g = block(Gain); s = block(Step); connect(s<0>, g<0>); g.getConfig(Gain Value)recipe
Gain Value = 1>>>G = tf([1],[1 1]); y = step(G, 5, 6); ycontrol
y = Time Series (6 samples, t = 0 .. 5) # Time Series>>>y.values()member
[[0], [0.632121], [0.864665], [0.950213], [0.981684], [0.993262]] # Matrix of Double>>>frobnicate 3exit 1
unknown command: frobnicate| x | Integer |
| y | Matrix of DoubleTime Series |
| v | Matrix of Double |
| G | Transfer Function |
Every line and every reply above is taken from the manual's real runs. MATLAB-style matrix literals and silencing semicolons go in, and Python-style calls, list-form replies and a type on every result come out. The fourth line doesn't compute anything. It puts a Step and a Gain on the canvas and wires them, and that edit is one step of the editor's Undo. The last line fails, says why and exits 1.
modelConfig, templates, generateRecipe, help …if, for, while, switch,
try, function and the restYou don't need to choose a language's habits before you start. A MATLAB user's line runs as written, and a Python user gets a REPL's replies. Every example below is a real run, copied verbatim.
[1 2; 3 4][[1, 2], [3, 4]]{{1, 2}, {3, 4}}Each one is a literal for the same 2×2. The console prints matrices in Python list form and stores them in MATLAB syntax, so the value you save reads back exactly as you wrote it.
x = 3; y = x*2y = 6 # Integerx = 3; y = x*2;(nothing, exit 0)A statement ending in ; is silent when it succeeds. % starts a comment,
... continues a line, and %{ … %} comments out a block, all as in MATLAB.
Errors are always printed. Silencing never hides a failure.
label = hello; labellabel = 'hello' # StringA bare name echoes its value, as in a REPL. Every reply is tagged with the variable system's real
type, so 1 < 2 (# Logical) is never confused with 1
(# Integer).
2 ^ 3 ^ 2 is 64, as in MATLAB[-2 ^ 2, 2 ^ 3 ^ 2, 2 ^ -1][[-4, 64, 0.5]] # Matrix of Double^ is left-associative, and unary minus binds more loosely than it does. This follows
MATLAB's rule, not the one most other languages use, so a line ported from MATLAB means the same
thing here.
end in a subscript, and arrays that growx = [1 2 3]; x(5) = 7; xx = [[1, 2, 3, 0, 7]] # Matrix of DoubleWriting past the end grows the array and fills the gap with zeros. A(:, 2) = []
deletes a column, and A(:) reads down the columns in MATLAB's order.
== compares exactly0.1 + 0.2 == 0.30 # LogicalThose two doubles really aren't equal, and the console doesn't pretend they are. 1/0
is Inf and 0/0 is NaN, as in MATLAB. Neither is an error.
It goes further than this: control flow,
script-local functions, anonymous functions, plots and eight toolboxes. A .m file can be
translated in and out.
See the MATLAB bridge →
A line splits into statements on top-level ; and ,. Each
statement is then read in a fixed order, which is how diagram statements, maths and commands share
one prompt without being mistaken for each other.
block(...), connect(...), handle.method(...), plots and
figure verbs. They are read before the maths grammar, so their syntax is never taken for
arithmetic.
A(i, j) = xWrites into a variable, grows it if needed, and deletes with = [].
name = rhsOnly the = that assigns, never the one inside ==, <=,
>= or ~=.
A defined variable echoes. After that come the seven constants (pi,
Inf, NaN, eps …), looked up last, so a variable can shadow
one, as in MATLAB.
A number, a [...] literal, or anything carrying an operator. It is evaluated with
MATLAB's precedence.
One of the 63 registered commands, and the rest of the line is its arguments.
name() is accepted as name.
Nothing matched → unknown command: <first word>, and the line fails
with exit 1.
The fourteen types a result can be. Each one is named in its reply and shown in the Variables panel.
ICoreBlocks --console "<line>" runs one line and exits. It goes
through the very same function the Quick Code panel calls, so everything the window does has a
console equivalent. Every transcript in the documentation is a real run of exactly this form.
; print.[[0], [0.632121], [0.864665], [0.950213], [0.981684], [0.993262]] # Matrix of Double
1/(s+1), and the curve drawn on the home page. You can check the answer
by hand.error: inv() needs a square matrix exit=1
Recipe statements act on the open project. block(Type, Parent) creates a
block, connect(a<1>, b<0>) wires output 1 to input 0, and
.setConfig, .move and .rename edit it.
generateRecipe prints the text that rebuilds a whole level. It is the same language
an agent writes.
g, s are names for
live blocks, listed in the Objects Tracker panel.Gain Value = K) and the block reads it when the run
starts.K = 2.5;
Gain = block(Control_Systems/Base_Blocks/Gain);
Gain.rename(Gain);
Gain.move(0, 0);
Gain.resize(70, 70);
Gain.setConfig(Sampling Time (s), -1);
Gain.setConfig(Gain Value, K);
… two more lines, as in the manual
K, and
the gain names it rather than copying 2.5. The project saves both.pole - function pole(G|sys) Poles of a transfer function or state-space model toolbox: Control System Toolbox
pause, input,
keyboard and dbstop are refused by name. The console runs your line on the
thread it draws with, and there is no interactive input.eval, evalin,
evalc and assignin are refused. Code held in a string can't be translated to
MATLAB and back, and every console line must be.global and persistent
are refused. A script-defined function gets its own workspace and no way to share one.while loop stops after 200,000 passes,
and function calls nest at most 200 deep. Each stops and says so rather than freezing the
window.sum(1:100000)), use it.A^0.5 is refused on a matrix
rather than approximated. Write sqrtm(A).--console run edits a fresh,
unsaved project, so it tests a line rather than editing a saved model. A bare
--console with no line never exits.The full engine is described in The command window, and everything you can type is listed in the command glossary.
See also: AI agents that edit the diagram · The maths in one place
Download the application from the customer portal, or read the documentation first - the manual, a page for every block, and the full command reference are public.