Adding Text To Table Data
Afficher commentaires plus anciens
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 commentaire
Ben van Zon
le 14 Sep 2023
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Data Type Conversion dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!