Python and MATLAB, both.

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.

Quick Code panel ICore Script IDE --console headless One evaluator for all three
Code Engine → Scripting → Quick Code MATLAB in · REPL out
  1. >>>x = 3; y = x*[1 2; 3 4]; ymaths y = [[3, 6], [9, 12]] # Matrix of Double
  2. >>>[1 2 3] >= 2logical [[0, 1, 1]] # Matrix of Logical
  3. >>>v = [3 4 5]; v(end - 1)index 4 # Integer
  4. >>>g = block(Gain); s = block(Step); connect(s<0>, g<0>); g.getConfig(Gain Value)recipe Gain Value = 1
  5. >>>G = tf([1],[1 1]); y = step(G, 5, 6); ycontrol y = Time Series (6 samples, t = 0 .. 5) # Time Series
  6. >>>y.values()member [[0], [0.632121], [0.864665], [0.950213], [0.981684], [0.993262]] # Matrix of Double
  7. >>>frobnicate 3exit 1 unknown command: frobnicate
A-  13pt  A+ ● ready● busy
>>>Enter Command
CanvasICore Blocks/Home
Variablesthe ones this session named
xInteger
yMatrix of DoubleTime Series
vMatrix of Double
GTransfer 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.

Commands
63
registered commands - modelConfig, templates, generateRecipe, help …
Matrix functions
990
465 in core MATLAB, the rest across eight toolboxes
Recipe verbs
83
statements that create, wire and configure blocks
Keywords
15
if, for, while, switch, try, function and the rest
01 · Both sets of habits

Type it the way you already do.

You 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.

Three spellings, one matrix

MATLAB, Python or C++ - the bracket accepts all three

MATLAB[1 2; 3 4]
Python[[1, 2], [3, 4]]
C++{{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.

From MATLAB

A semicolon silences, a comma doesn't

inx = 3; y = x*2
outy = 6 # Integer
inx = 3; y = x*2;
out(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.

From Python

Type a name, see its value - and its type

inlabel = hello; label
outlabel = 'hello' # String

A 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).

MATLAB's precedence, surprises included

2 ^ 3 ^ 2 is 64, as in MATLAB

in[-2 ^ 2, 2 ^ 3 ^ 2, 2 ^ -1]
out[[-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.

Indexing

end in a subscript, and arrays that grow

inx = [1 2 3]; x(5) = 7; x
outx = [[1, 2, 3, 0, 7]] # Matrix of Double

Writing 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.

Honest arithmetic

== compares exactly

in0.1 + 0.2 == 0.3
out0 # Logical

Those 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 →

Quick Code
The step response from the session above, then a matrix and its inverse, typed into the real Quick Code panel. MATLAB-style literals and silencing semicolons go in; Python-style calls and list-form replies come out.
02 · How a line is read

Six readings, first match wins.

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.

1 · Recipe

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.

2 · Indexed assignment

A(i, j) = x

Writes into a variable, grows it if needed, and deletes with = [].

3 · Assignment

name = rhs

Only the = that assigns, never the one inside ==, <=, >= or ~=.

4 · A known name

Variables, then constants

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.

5 · Expression

Numbers and operators

A number, a [...] literal, or anything carrying an operator. It is evaluated with MATLAB's precedence.

6 · Command

The first word names it

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.

IntegerDoubleMatrix of Double LogicalMatrix of LogicalString PolynomialTransfer FunctionState Space Zero Pole GainStructTime Series SymCurve Fit

The fourteen types a result can be. Each one is named in its reply and shown in the Variables panel.

03 · Headless is the same console

A build script can type too.

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.

  • Outputstdout on success, stderr on failure.
  • Exit code0 or 1, from the line's verdict, so a pipeline can gate on it.
  • ChainsStatements run in order and stop at the first failure. Only the ones not ending in ; print.
  • Fresh startEach process starts with an empty variables space and an unsaved project. Nothing carries over from one run to the next.
$ ICoreBlocks --console "G = tf([1],[1 1]); y = step(G, 5, 6); y.values()"
[[0], [0.632121], [0.864665], [0.950213], [0.981684], [0.993262]]  # Matrix of Double
The samples of 1 − e−t at t = 0…5: the step response of 1/(s+1), and the curve drawn on the home page. You can check the answer by hand.
$ ICoreBlocks --console "x = 3; y = inv([1 2 3]); y"
error: inv() needs a square matrix
exit=1
The failing statement stops the chain, its reason goes to stderr, and the process exits 1.
04 · The canvas listens

It is also where diagrams are built.

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.

  • UndoEvery statement that edits the diagram is one step of the editor's Undo, so Ctrl+Z takes back a console edit.
  • Handlesg, s are names for live blocks, listed in the Objects Tracker panel.
  • VariablesType a console variable's name into a block parameter (Gain Value = K) and the block reads it when the run starts.
  • SavedThe variables space is saved with the project, as the first lines of its recipe text.
>>> K = 2.5; g = block(Gain); g.setConfig(Gain Value, K); g.listConfig; generateRecipe
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
The first line of the recipe is the console variable K, and the gain names it rather than copying 2.5. The project saves both.
05 · Help that knows where a name comes from

Tab, help, history.

  • TabCompletes the current name from the glossary: commands, matrix functions and recipe verbs. A popup lists the candidates while you type.
  • help <name>Describes one name and, for a function MATLAB keeps in a toolbox, says which toolbox. That tells you whether the MATLAB side will need a licence for it.
  • HistoryUp and Down walk every line you've submitted. The history is saved to disk on every submit, so a crash loses nothing, and it keeps 500 lines by default (up to 5,000).
  • who · whosNames, sizes, bytes and classes of everything in the variables space. The Variables panel is the table view of the same store.
> help pole
pole  -  function
  pole(G|sys)
  Poles of a transfer function or state-space model
  toolbox: Control System Toolbox
Most names have no toolbox line at all. They are core MATLAB, which needs no licence beyond MATLAB itself.
Honest edges

Where it stops, it says so.

  • Interactive namespause, 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.
  • Code in stringseval, 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.
  • Shared stateglobal and persistent are refused. A script-defined function gets its own workspace and no way to share one.
  • CeilingsA 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.
  • Loops are not the fast pathA pass costs about 68 µs, because each line is read as a statement. When a whole-matrix expression says what you mean (sum(1:100000)), use it.
  • Matrix powersA^0.5 is refused on a matrix rather than approximated. Write sqrtm(A).
  • HeadlessEach --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.
  • CompletionTab completes glossary names, not your own variables or block types.

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

Get started

See it run on your own model.

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.