[Scilab-users] Seemingly inconsistent behavior

Federico Miyara fmiyara at fceia.unr.edu.ar
Tue Jan 15 03:36:50 CET 2019


Dear all,

This statement

a = {[%f, %t], {2; poly([3, 2],'v')}}

defines a cell array whose first element is a boolean row vector and 
whose second element in turn is another cell array.

Invoking a{1}(1) correctly returns the boolean value F.

But a{2}{1} does not return 2, as expected but an error:

Error: syntax error, unexpected {, expecting end of file

However

b  =  a{2}
b{1}

returns the correct value 2.

Why, if a{2} is a cell array, its entries cannot be extracted with the 
curly brackets {}?

Moreover a{2}(1) and a{2}(2) should be the constant 2. and the polynomial

            2
    6 -5v +v

respectively,  but they are reported as cell arrays, since

iscell(a{2}(1)) and  iscell(a{2}(2)) are both True

Why is a cell array responsive to () at all and why it returns a sub ell 
array?

Thank you in advance.

Regards,

Federico Miyara




---
El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
https://www.avast.com/antivirus




More information about the users mailing list