Adding Text To Table Data
Ältere Kommentare anzeigen
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 Kommentar
Ben van Zon
am 14 Sep. 2023
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!