Table with multiple types
0 Comments
Answers (3)
0 Comments
0 Comments
@Gavin and @Matt J,
I also wanted to share some documentation insights that might help clarify this mixed-type uitable issue.
To Gavin: You correctly identified that the table() constructor interprets char vectors as parameter names, which is why string conversion was necessary. However, for iterative row additions like yours, cell array syntax is more efficient:
app.LicksTable.Data(end+1,:) = {PType, PData};This eliminates both the char/string conversion step and the repeated table array construction overhead.
To Matt J: Your cell array solution is exactly the documented approach. For others reading this thread, it extends naturally to multiple rows:
uit.Data = {PType1, PData1; PType2, PData2; PType3, PData3};
Bottom line: For mixed-type uitable data, cell arrays are simpler and more performant than table array construction, especially when adding rows programmatically.
Hope this helps!
0 Comments
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!