MATLAB Answers

Subscripts and greek letters on a cell array

34 views (last 30 days)
Martina Clairand
Martina Clairand on 8 Feb 2021
Commented: Walter Roberson on 11 Feb 2021
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));
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'};
T = table(Compound,stock,Vv);
figure (1)
uitable('Data',T{:,:},'ColumnName',head , 'RowName',T.Properties.RowNames,'Units', 'Normalized', 'Position',[0, 0, 1, 1]);

Answers (1)

Kiran Felix Robert
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.
Refer the answer here for entering subscripts in UITABLE/UICONTROL using HTML
  1 Comment
Walter Roberson
Walter Roberson on 11 Feb 2021
Note that the HTML approaches are only available for traditional figures and not for uifigure

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!