Readtable function reads the return of CRSP data as cell array
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
David Schaefer
am 11 Okt. 2019
Kommentiert: David Schaefer
am 15 Okt. 2019
I want to work with CRSP stock data in matlab but when I use the funtion readtable to import the data, which I have as a CSV file, I have some issues.
If you look at the picture you see that the function reads the returns of the file as a cell array but I want it as a numeric number just as the price or the shares outstanding.
Is there an easy way to convert it?
Thanks!
0 Kommentare
Akzeptierte Antwort
Joe Vinciguerra
am 11 Okt. 2019
Bearbeitet: Joe Vinciguerra
am 11 Okt. 2019
This will convert that column to numbers (assuming all elements in that column can be converted to numbers)
(EDIT: sorry I haven't had my coffee yet. This is correct now...)
variableName.RET = str2double(variableName.RET(:));
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!