Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.1 - Français

Change language to:
English - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Aide de Scilab >> Listes Structures Cells > cells > cell

cell

creates a cell array of empty matrices

Syntax

c = cell()
c = cell(m1)
c = cell(m1, m2)
c = cell(m1, m2, ..., mn)
c = cell(x)

Arguments

x

a vector containing the dimensions of the cell to create.

m1, m2, ..., mn

dimensions of the cell to create.

Description

cell returns a cell array of empty matrices.

cell()

returns a (0, 0) cell array of empty matrices.

cell(m1)

returns a (m1, m1) cell array of empty matrices.

cell(m1, m2)

returns a (m1, m2) cell array of empty matrices.

cell(m1,m2,..,mn)

creates a (m1, m2, ..., mn) cell array of empty matrices.

cell(x)

returns a cell array of empty matrices with: the first dimension of the cell array is x(1), the second dimension is x(2) and so on.

Remarks

cell(x) is not the same size that x.

cell() is equivalent to cell(0).

If A is a cell array, you can access the contents of an element of A by using A{m1, m2, ..., mn}. The expression A(1,1) = zeros(2,2) is not valid, the right syntax is A{1,1} = zeros(2,2).

Examples

a = cell(3)
b = cell(3,1)
c = cell([2,3,4])

// Assigning cell entries
b = cell(3,1);

// Assigning the first element of b using {}
b{1} = 1:3

// Assigning the second element of b using {}
b{2} = 'Scilab'

// Assigning the third element of b using the 'entries' field
b{3} = poly(1:3,'s')

// Assigning sub-cells
X = cell(3,2);
X{:,1} = b

// Extracting a sub-cell: result is a cell
b{1}
b{1:2}

// Extracting a sub-cell value: result is an array
b{1}

// Dimensions of b as a double value
size(b)

See also

  • eye — matrice identité
  • ones — matrice remplie de 1
  • zeros — matrice nulle
  • iscell — checks if a variable is a cell array

History

VersionDescription
6.0.0

Fields "entries" and "dims" do not exist anymore. To assign or extract an element, use {}.

Report an issue
<< cells cells cell2mat >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Jan 03 14:33:08 CET 2022