I have an Excel sheet with headers of different depths and the numbers are not being read (ex.: d=-12.82m is being read as x_12_82M),
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying to convert from Excel to a different format, for different depths but the headers are not being read properly.
I even tried changing it manually in Excel but if I do, they will be read as part of the data and not as headers
1 Commento
Risposta accettata
Chunru
il 20 Nov 2023
% The first row is treated as var names. Use preserve to keep the original
% format
a = readtable("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1544212/Sample.xlsx", "VariableNamingRule", "preserve")
s = a.Properties.VariableNames; % get the variable names
whos
d = cellfun(@(x) sscanf(x, "%f"), s(2:end) ) % convert to depth
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Spreadsheets in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!