Reading string from an exel file using xlsread
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hello Everyone, How are you?
Well, I'm trying to read a Exel file with Missing Values using xlsread, but when I run the code, the date column is save as a number.
>> [a,b,c] = xlsread('001_xlsx.xlsx',1, 'B6:F12'); >> a
a =
1.0e+04 *
4.2433 0.0005 0.0005 0.0601 0
4.2433 0.0005 0.0005 0.0598 0
4.2433 0.0005 0.0004 0.0604 0
4.2433 0.0005 0.0003 0.0582 0
4.2433 0.0005 0.0003 0.0589 0
4.2433 0.0005 0.0002 0.0595 0
4.2433 0.0005 0.0002 0.0595 0
>> b
b =
{}
>> c
c =
[4.2433e+04] [4.6700] [5.2000] [601.0680] [0]
[4.2433e+04] [4.6600] [4.6000] [597.9430] [0]
[4.2433e+04] [4.6800] [3.7000] [604.1940] [0]
[4.2433e+04] [4.6100] [3.4000] [582.3580] [0]
[4.2433e+04] [4.6300] [2.8000] [588.5880] [0]
[4.2433e+04] [4.6500] [2.2000] [594.8170] [0]
[4.2433e+04] [4.6500] [1.8000] [594.8170] [0]
Dates in the exel file have this format (single column),
ans =
3/4/16 0:47
3/4/16 1:47
3/4/16 2:47
3/4/16 3:47
3/4/16 4:47
3/4/16 5:47
3/4/16 6:47
My questions, is how can I save that column as a string?, in that way, I can use datenum to convert that time format.
Thanks.
2 Commenti
Walter Roberson
il 4 Lug 2016
Your file is inconsistent. "Nro" 2136 and above have the date in "General" format, but 2137 and below have the date in custom date format.
David du Preez
il 5 Lug 2016
Risposte (0)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!