Adding Text To Table Data
Show older comments
I wanna give names to transitions in my file, but whenever I want to name something it changes to a numerical value or NaN.
So whenever the value is -1 -> P, 0 -> Q and 1 -> R.
FileName = 'ct4004355_si_003.txt';
T = readtable('ct4004355_si_003.txt', 'Delimiter','\t', 'TextType','string');
Rows = T(130:154,[1 2 3 4 5 6 11 12 13 14]);
Rows.Properties.VariableNames = ["Wavenumber [cm-1]", "Uncertainty", "v1u", "v2u", "L2u", "Ju", "v1l", "v2l", "L2l", "Jl"];
PR = Rows.Ju-Rows.Jl;
Rows = [Rows table(PR, 'VariableNames', {'Branch'}) ];
Rows.Branch(ismember(Rows.Branch, [-1])) = 'P'
1 Comment
Ben van Zon
on 14 Sep 2023
Accepted Answer
More Answers (0)
Categories
Find more on Data Type Conversion 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!