how to format cell array

so my code outputs a 1x36 cell array in the workspace when executed, i need to reformat the cell array so that once you double click the 1x36 cell array all the values are 1x1 cells. so for instance i click on the 1x36 cell array and if i need the 4th column value i go to the fourth column and double click the 1x1 cell and then the value appears.

3 个评论

I'm not sure I understand complete so correct me if I'm wrong. You currently have a cell array like this
a = {1 2 3 4 5 6};
but you want this
a = {{1} {2} {3} {4} {5} {6}};
Is that right?
Why not just use a regular 1D vector array and have all the values directly?
a=cell2mat(c);
No clickee needed... :)
Cell arrays are fine when one has either disparate data types or "jagged" arrays or the like, but when "regular" array will suffice it's generally much simpler to code and less memory and faster to boot...
But, iff'en you're determined, I think what you're asking for is
c=num2cell(c{:});

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Logical 的更多信息

编辑:

dpb
2018-7-1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by