table2cell — Convert a table into a cell array.
table2cell(T) returns an height(T) by width(T) cell array of table element values.
Syntax
C = table2cell(T)Inputs
T- Type
Any- Required
- Yes
- Description
- Input table or timetable.
Returns
B- Type
Any- Description
- Converted output value.
Errors
RunMat:table:InvalidArgument- When
- Arguments or table metadata are invalid.
- Message
table: invalid argument
RunMat:table:InvalidIndex- When
- Table indexing is invalid.
- Message
table: invalid index
RunMat:table:InvalidVariable- When
- A table variable name or value is invalid.
- Message
table: invalid variable
Behavior
Each table variable contributes its contents to the corresponding output cells.
Integer elements retain their exact class and value, including wide int64 and uint64 values.
Multi-column variables are preserved as same-row slices in the corresponding cell.
Execution and placement
Conversion runs on host table metadata.
Host-side conversion is a fusion boundary.
Example
Converting Table Elements To Cells
T = array2table([1 3;2 4]); C = table2cell(T)Using table2cell with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how table2cell changes the result.
Run a small table2cell example, explain the result, then change one input and compare the output.
Related Table functions
Table
array2table · array2timetable · categorical · cell2table · dictionary · groupsummary · head · iscategorical · isordinal · istable · istimetable · ordinal · pivot · rowfilter · struct2table · table · table2array · table2struct · table2timetable · timerange · timetable · timetable2table · uitable · vartype
Indexing
dictionary.subsasgn · dictionary.subsref · table.subsasgn · table.subsref
Source you can read
Every RunMat function's source is public. Read exactly how table2cell is executed, line by line, in Rust.
- View the source for table2cell in Rust on GitHub
- Learn how the RunMat runtime works
- Found a bug? Open an issue with a minimal reproduction.
About RunMat
RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/license.
- RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
- Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.