Import CSV file with mixed data types

前端 未结 9 2274
眼角桃花
眼角桃花 2020-11-27 04:13

I\'m working with MATLAB for few days and I\'m having difficulties to import a CSV-file to a matrix.

My problem is that my CSV-file contains almost only Strings and

9条回答
  •  -上瘾入骨i
    2020-11-27 05:15

    Use xlsread, it works just as well on .csv files as it does on .xls files. Specify that you want three outputs:

    [num char raw] = xlsread('your_filename.csv')
    

    and it will give you an array containing only the numeric data (num), an array containing only the character data (char) and an array that contains all data types in the same format as the .csv layout (raw).

提交回复
热议问题