Table formatting in variable viewer question.

Hello everyone,
So I am extracting some data out from analysis I am conducting into tables. Interestingly they seem to be differently formatted and I can not figure out why. The table 't' is based on feature exctraction through 'regionprops' and looks like below in the variable viewer:
However, tha table 't2' is produced by using the 'table' function and looks like below in the variable viewer:
Does anyone have any idea why the second table is not formatted in the more interactive manner?
Cheers!

3 件のコメント

VBBV
VBBV 2023 年 8 月 3 日
編集済み: VBBV 2023 年 8 月 3 日
There may be nested table within variable t2 assigned to variable val. can you share the data file ?
Walter Roberson
Walter Roberson 2023 年 8 月 3 日
Good question. So far I have only observed that for arrays that are fairly large, or more than 2 dimensions. But your t2 is smaller than your t1 and tables are always 2D, so I do not know why this is happening for you.
Michael Savage
Michael Savage 2023 年 8 月 3 日
Hello,
Please find the .mat file containing the tables attached.
Thanks!

サインインしてコメントする。

回答 (1 件)

Sanjana
Sanjana 2023 年 8 月 22 日

0 投票

Hi Michael,
I understand that you are facing an issue with the table formatting in the variable viewer. The problem is due to the presence of 3 dimensional arrays in the “t2.pFit” column.One possible solution, is to use “squeeze” function to remove dimensions of length 1, there by converting the 3 dimensional arrays in the “t2.pFit” column each to the size of “2x2 double”.
Below is the code for the above solution,
% converting table to cell to use cellfun
t2_cell = table2cell(t2)
%applying squeeze function to remove Dimensions of length 1 in pFit column
t2_cell_modified = cellfun(@squeeze,t2_cell,'UniformOutput',false)
%converting cell to table
t2_modified = cell2table(t2_cell_modified)
Please refer to the following documentation, for further information
Hope this helps.
Regards,
Sanjana

カテゴリ

製品

リリース

R2022a

質問済み:

2023 年 8 月 3 日

回答済み:

2023 年 8 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by