How read hex values from CSV?

19 ビュー (過去 30 日間)
Tomas Svoboda
Tomas Svoboda 2018 年 5 月 6 日
回答済み: Star Strider 2018 年 5 月 6 日
Hi all, I have file which looks as:
</matlabcentral/answers/uploaded_files/116340/hex_csv.PNG> So, I need read only fourth column, how can I do it?

回答 (1 件)

Star Strider
Star Strider 2018 年 5 月 6 日
Assuming it was not created by Excel, use the textscan (link) function.
I would do something like this:
filename = 'hex.csv';
fidi = fopen(filename, 'rt');
D = textscan(fidi, '%*f %*f %*f %s %*s', 'Delimiter',',');
The ‘D’ output will be a cell array of strings.
You may have to experiment to get the result you want. See the textscan documentation for the options the function offers.
If it was created by Excel, and if xlsread has problems with it, use the xlsread (link) function.

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by