[Scilab-Dev] SEP #95 : ismatrix(), isrow(), iscolumn(), IsAScalar()

Samuel Gougeon sgougeon at free.fr
Sat May 18 14:09:52 CEST 2013


In addition, the suggested implementations work also for arrays of 
structures
or/ and cell(), with unchanged answers. Tests are provided here-below 
for structures.

Other remarks have been posted on bugzilla:
http://bugzilla.scilab.org/show_bug.cgi?id=10456#c4

Samuel Gougeon

----------------------------------------------
// Scalar structure
clear s
s.a = "test";
isscalar(s)
isrow(s)
iscolumn(s)
ismatrix(s)
issquare(s)

// Column array of structures
clear s
s(3,1).a = %pi;
isscalar(s)
isrow(s)
iscolumn(s)
ismatrix(s)
issquare(s)

// Row array of structures
clear s
s(1,3).a = %e;
isscalar(s)
isrow(s)
iscolumn(s)
ismatrix(s)
issquare(s)

// 2D array of structures (not square)
clear s
s(3,2).a = %z;
isscalar(s)
isrow(s)
iscolumn(s)
ismatrix(s)
issquare(s)

// 3D (cubic) array of structures
clear s
s(2,2,2).a = %s;
isscalar(s)
isrow(s)
iscolumn(s)
ismatrix(s)
issquare(s)

// 3D array of structures with a singleton dimension (=>square)
clear s
s(2,1,2).a = %s;
isscalar(s)
isrow(s)
iscolumn(s)
ismatrix(s)
issquare(s)



More information about the dev mailing list