how set width column in table app designer

hi,
you see in this pics: column A(date), column B(number), column C(number)
i don't know the max of "number" columns(B,C,,)
In the first column i set width to {90}
But i want in the 2,3,4... columns set width to 30.
How can i do it?
[app.UITableFilteredTable.Data]=Table_HistoricalTable_Struct(app.Eq);
x=repmat({90},1,height(app.UITableFilteredTable.Data));
app.UITableFilteredTable.ColumnWidth =x;
app.UITableFilteredTable.ColumnName ={};

4 commentaires

Dyuman Joshi
Dyuman Joshi le 1 Août 2023
"i don't know the max of "number" columns(B,C,)"
Then how did you define the table?
pipin
pipin le 1 Août 2023
the table depends from variable element
>> size(Table_HistoricalTable_Struct(Eq))
t23 =
1×3 cell array
{[" "]} {["FILTRED STRATEGIES FULL HISTORY "]} {[""]}
ans =
192 3
>>
function [T]=Table_HistoricalTable_Struct(Eq)
sis=[Eq.Ns]';
t1=num2cell(sis);
t2=num2cell(1:height(t1))';
t23=[{" "},{"F ************************ "},repmat({""},1,numel(sis)-1)]
a=repmat({""},1,numel(sis)+1);
t22=[t23;a;{""},t2';{""},t1'];
fil=string(Eq.Filtri.filtred_posSiz);
t5=[Eq.RP_S];
t5=string(t5);
T2=array2table(t5);
T3=array2table(fil);
% t23=[{" "},{"FILTRED STRATEGIES FULL HISTORY "};{" "},{" "}]
T_=[T2,T3];
T_=flip(T_);
T =[t22;T_];
end
Dyuman Joshi
Dyuman Joshi le 1 Août 2023
What is the input you provide to this function?

Connectez-vous pour commenter.

 Réponse acceptée

Voss
Voss le 1 Août 2023
x = [{90} repmat({30},1,size(app.UITableFilteredTable.Data,2)-1)];
app.UITableFilteredTable.ColumnWidth = x;

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by