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!

 採用された回答

Joe Vinciguerra
Joe Vinciguerra 2019 年 10 月 11 日
編集済み: Joe Vinciguerra 2019 年 10 月 11 日

0 投票

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(:));

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Tables についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by