How to hide data in a UITable ?

조회 수: 27 (최근 30일)
Gwendal Marrec
Gwendal Marrec 2022년 8월 11일
댓글: Gwendal Marrec 2022년 8월 11일
Hello,
I am plotting data in a UITable on App Designer.
Here is what my code looks like :
paramD = struct('name',"frequence",'unite',"GHz",'nb',numel(freq),'liste',freq,'scattering',s_list);
app.Table.Data = struct2table(paramD);
app.Table.ColumnName = struct2table(paramD).Properties.VariableNames;
Like so, the table looks like this :
'liste' data could sometimes take up to 500 values.
And I would like the table to be :
without having to create an empty row in the table like this line of code does :
paramD = struct('name',{"frequence",""},'unite',{"GHz",""},'nb',{numel(freq),0},'liste',{freq,0},'scattering',{s_list,0});
Do you know how to hide data so it only appears as '1x154 double' instead of the whole list ?
Thanks in advance,
Gwendal
  댓글 수: 3
Gwendal Marrec
Gwendal Marrec 2022년 8월 11일
@Walter Roberson, smart but that does not work.
It makes the columns shorter or larger but it does not change the way cells are displayed.
Right now, the only way I've found to display simply '1x154 double' instead of a whole array is when there are multiple rows with different arrays length.
Otherwise, when there is only one row, it automatically displays the whole array. Can you think of a workaround that could work ?
Walter Roberson
Walter Roberson 2022년 8월 11일
No, not for the built-in classes. If this were for your own class, you could matlab.mixin.CustomDisplay class

댓글을 달려면 로그인하십시오.

채택된 답변

Kevin Holly
Kevin Holly 2022년 8월 11일
You could do this workaround:
paramD = struct('name',"frequence",'unite',"GHz",'nb',numel(freq),'liste',{freq,0},'scattering',s_list);
app.UITable.Data = struct2table(paramD);
app.UITable.Data(2,:)=[];
app.UITable.ColumnName = struct2table(paramD).Properties.VariableNames;
  댓글 수: 1
Gwendal Marrec
Gwendal Marrec 2022년 8월 11일
Yes, I tried to avoid creating a temporary line and then deleting it, but this may be the only solution. It works, thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by