How to preserve subscript or superscript formatting in a text string?

3 views (last 30 days)
I'm reading out some text strings (units) from some Excel files:
filename = 'AAA.xlsx';
opt = detectImportOptions(filename);
opt.VariableUnitsRange = '2:2'; % 2nd row
T1 = readtable(filename, opt);
The problem is that I would have a unit like this: mol kg^-1, and after it is read out, the superscript formatting of "-1" is lost.
Is there an option so that I could preserve the superscript formatting?
Thanks.

Answers (0)

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!