Le 05/12/2019 à 14:25, Federico Miyara a écrit :

Dear all,

When using makecell such as in

--> u = makecell([2 2], cos, 'hello', 1+%s^2, [1 2; 3 4])
 u  =

  [  1 fptr      ]  [1x1 string  ]
  [1x1 polynomial]  [2x2 constant]

we get a cell array where the unidimensional ordering of the cells goes first along columns and then ows. However, when extracting components unidimensionally, it behaves the other way around:

--> u(1:4)
 ans  =

  [  1 fptr      ]
  [1x1 polynomial]
  [1x1 string    ]
  [2x2 constant  ]

The same happens wen applying matrix:

--> matrix(u,4,1)
 ans  =

  [  1 fptr      ]
  [1x1 polynomial]
  [1x1 string    ]
  [2x2 constant  ]

--> matrix(u,1,4)
 ans  =

  [1 fptr]  [1x1 polynomial]  [1x1 string]  [2x2 constant]

Isn't this inconsistent?
Shouldn't makecell create the cell array going along rows and then columns?

No, the doc says:

s= makecell(dims,a1,a2,...an) creates a cell array of dimensions given by dims with the given input arguments. The ai are stored along the last dimension first.



Regards,

Federico Miyara


_______________________________________________
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users

--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to