c=array2cell([array])
array : | arrays of structs |
c : | cell list of input values |
a=dir(pwd);
array2cell(a.name)
{a.name}' % fasten than elem2rows
{a.name} % faster than elem2cols
[a.datenum] % rows
[a.datenum]' % cols
This function, array2cell
, is designed to convert object arrays into cell arrays. It is part of the SolidGeometry library and was introduced in version 4.4. The function is authored by Tim Lueth and is classified under auxiliary procedures.
varargin
.The function array2cell
is defined to take a variable number of input arguments using varargin
. The main operation performed by the function is to transpose the input arguments and assign them to the output variable c
. This effectively converts the input array into a cell array.
An example provided in the comments demonstrates how to use the function:
a = dir(pwd); array2cell(a.name)
In this example, the dir
function is used to get a list of files and directories in the current working directory. The array2cell
function is then used to convert the names of these files and directories into a cell array.
The function documentation mentions several related functions that might be of interest:
get
elem2array
arrayof
cell2class
class2cell
These functions are likely part of the same library and may offer complementary functionality for handling arrays and cell arrays.
Algorithm explaination created using ChatGPT on 2025-08-18 22:39. (Please note: No guarantee for the correctness of this explanation)