Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Português - 日本語 - Русский
Aide de Scilab >> Interface graphique > x_matrix


Edits a matrix and waits for validation (modal)


matrixOut = x_matrix(Header, matrixIn)


column vector of text: Text displayed before the matrix. Extended UTF-8 characters are supported. Any element starting with "<body>" can use HTML.4 tags afterward.

Initial vector or matrix of booleans, encoded integers, real or complex numbers, or text.

Modified matrix, of the same type than matrixIn, if "OK" is pressed. Or [] if "Cancel" is pressed.


Edits a matrix in a modal way: Scilab is paused while the matrix is displayed and the user can modify it. One of both buttons "OK" or "Cancel" must be clicked to validate or cancel modifications. Either the modified matrix or [] is returned accordingly. Then Scilab resumes the execution of next instructions.

The pop-up is sized according to the displayed matrix. It can be resized interactively. If it becomes narrower than the matrix or the header, long header lines are wrapped, and some scroll bars appear.


i = int8(grand(3,4,"uin",-150,150))

// With booleans
b = i > 0
m = x_matrix("<html><body>Matrix of <b>booleans", b)

// With encoded integers
m = x_matrix("<html><body>Matrix of <b>int8 integers", i)

// With real numbers
c = grand(5,4,"uin",-15,15) + grand(5,4,"uin",0,9)/10;
c([14 8 16]) = [%nan %inf -%inf]
m = x_matrix("<html><body>Matrix of <b>decimal numbers", c)

// With complex numbers
c = grand(5,3,"uin",-15,15) + grand(5,3,"uin",-15,15)*%i;
c(2,2) = 3-1.24e-31*%i;
c(4,3) = complex(0,%nan)
m = x_matrix("<body>Matrix of <b>complex numbers", c)

// With texts
t = ["ab" "I don''t" "αβδεϵζ"
     "j"  """Yes"""  "àéêèïôûù"]
m = x_matrix("<body>Matrix of <b>text", t)

With a multiple-line and styled header:

online = "";
header = ["<body><h3>Head line"
          "The pop-up can be resized. Some scroll bars may appear."
          "<body>This <font color=''red''><b>word</b></font> is bold and red. " + ..
          "<body>x_matrix <a href=''" + online + "''>online page</a>."
b = grand(4,14,"uin",-2,1) < 0
m = x_matrix(header, b)

See also


6.1.1 Booleans, encoded integers, and text are supported. The display of real and complex matrices is improved.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Jul 20 11:19:21 CEST 2021