Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.1 - English

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

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

Scilab Help >> Matlab to Scilab Conversion Tips > Matlab-Scilab equivalents > S > size (Matlab function)

size (Matlab function)

Array dimension

Matlab/Scilab equivalent

Matlab Scilab

Particular cases

Due to the fact that strings or not considered in the same way in Matlab and in Scilab, results are not equal for string matrices, convert it using m2scistr to have the same result.

d = size(X,dim)

If dim is greater than number of dimensions of X, Matlab returns d=1, but in Scilab, you get an error message. Scilab mtlb_size can work with dim greater than number of dimensions of X.

[d1,...dn] = size(X)

If n is greater than number of dimensions of X, all "extra" variables are set to 1 in Matlab but Scilab returns an error message. Scilab mtlb_size returns a Matlab like result in these cases. When n is less than number of dimensions of X, dn contains the product of the sizes of the remaining dimensions in Matlab but in Scilab dn = size(X,n), use mtlb_size for such uses.

Report an issue
<< sinh (Matlab function) S sort (Matlab function) >>

Copyright (c) 2022-2024 (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 Feb 12 19:26:59 CET 2018