importdata() question
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I need help understanding what's happening here, any input would be appreciated.
Here is my code:
import1 = importdata('Historical_Data/ES.csv');
price_low=import1.data(:,1);
I'm reading a .csv file with values like the following
Date,Low
2/17/12,1353
2/16/12,1334.25
2/15/12,1338
2/14/12,1337.75
The values are being save to my array as
1.3530
1.3342
1.3380
1.3377
I'd like the value to be the same as they are in the file.
Is this an ASCII issue?
0 Kommentare
Antworten (1)
Geoff
am 15 Mär. 2012
Are you sure? If you look closely, you'll see the display is saying '1.0e+003 *'. That means your numbers are correct, but are being shown in scientific form.
If you really want them to look identical to the input file, read them as strings with textread:
filename = 'Historical_Data/ES.csv';
[mydate, myval] = ...
textread( filename, '%s%s', 'headerlines', 1, 'delimiter', ',' );
2 Kommentare
Geoff
am 15 Mär. 2012
Yeah, they're the same numbers. MatLab just declutters the view a little in the command window by saying "ah well, everything's 1000x".
Siehe auch
Kategorien
Mehr zu Data Import and Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!