Subscripts and greek letters on a cell array
15 views (last 30 days)
Show older comments
Hello I'm trying to create the following table, in which there are some elements that contain the greek letter µ and also some subscripts such as in K_2HPO_4. However I don't manage to display them in a proper way. Do you have an idea on how to fix it?
sum= (8+8+6+2.9+1.33/2+1.33/2+1.33/2+1.33/2+1.7+1.7);
Peg=num2str(round(8/sum*2/3*2/2.6, 3));
Pep=num2str(round(8/sum*2/3*2/2.6,3));
Trolo=num2str(round(6/sum*2/3*2/2.6,3));
Mix=num2str(round(2.9/sum*2/3*2/2.6,3));
Gluco=num2str(round(1.33/(2*sum)*2/3*2/2.6,3));
Dtt=num2str(round(1.33/(2*sum)*2/3*2/2.6,3));
Cat=num2str(round(1.33/(2*sum)*2/3*2/2.6,3));
GO=num2str(round(1.33/(2*sum)*2/3*2/2.6,3));
ATpp=num2str(round(1.7/sum*2/3*2/2.6,3));
Pkl=num2str(round(1.7/sum*2/3*2/2.6,3));
Streptavidin=num2str(round(1/11*10/sum*2/2.5,3));
Kinesin=num2str(round(10/11*10/sum*2/2.6,3));
Microtubules=num2str(round(0.5/2.6,3));
head={'Compound','Stock solution','% v/v'}
Compound={'M2B'; 'PEG';'PEP';'trolox'; 'MIX'; 'Glucose'; 'DTT';'Catalase';
'Glucose Oxydase'; 'ATP'; 'PKLDH'; 'Streptavidin'; 'Kinesin'; 'Microtubules'};
Vv=['-----';Peg; Pep; Trolo; Mix; Gluco; Dtt; Cat; GO; ATpp; Pkl; Streptavidin; Kinesin; Microtubules];
stock={'80mM Pipes + 2mM MgCl_2 + 1mM EGTA ';'12% w/w';'200 mM';'20 mM in 20mM (K_2HPO_4)';'933 uL M2B + 67 \mu L MgCl_2(1M)';
'300mg/ml in 20mM K_2HPO_4 + 70mM KCl'; '0.5 M';'3.5 mg/ml in 20mM K_2HPO_4 + 100mM KCl';
'20mg/ml in 20mM K_2HPO_4'; '50 mM'; '600-1000 units/mL';'0.352 mg/ml' ;'0.07 mg/mL'; '8mg/mL'};
Vv=cellstr(Vv);
T = table(Compound,stock,Vv);
figure (1)
uitable('Data',T{:,:},'ColumnName',head , 'RowName',T.Properties.RowNames,'Units', 'Normalized', 'Position',[0, 0, 1, 1]);
0 Comments
Answers (1)
Kiran Felix Robert
on 11 Feb 2021
Hi Martina,
You can refer the answer thread here to learn more about displaying Greek characters in the UITABLE/UICONTROL.
Refer the answer here for storing special characters into a string. For Greek letter ‘u’ the example is as follows,
mu = cellstr(char(956));
The above will store it into a cell array.
1 Comment
Walter Roberson
on 11 Feb 2021
Note that the HTML approaches are only available for traditional figures and not for uifigure
See Also
Categories
Find more on Labels and Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!