[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: data resampling



I tried Matlab's readtable on the examples from that post and it worked fine



>> x = readtable('d:\testfile.csv');
>> x
x =
    Height    Width    Depth    Weight      Label       Age     Speed
    ______    _____    _____    ______    _________    _____    _____
    95.01     76.21    61.54    40.57     'Charlie'    20.28     1.53
    23.11     45.65    79.19    93.55     'Echo'       19.87    74.68
    60.68      1.85    92.18    91.69     'Delta'      60.38    44.51
     48.6     82.14    73.82    41.03     'Alpha'      27.22    93.18
    89.13     44.47    17.63    89.36     'Romeo'      19.88     46.6
>> class(x.Width)
ans =
double
>> class(x.Label)
ans =
cell
>> y = readtable('d:\testfile2.csv');
>> y
y =
    target_spacing    subject    sensitivity    direction_content
    ______________    _______    ___________    _________________
    2.0944            'as'           4.387      0.1             
    2.0944            'cj'          3.2103      0.1             
    2.0944            'jb'          6.2939      0.1             
    2.0944            'je'       -0.032859      0.1             
    2.0944            'ko'        -0.43184      0.1             
    2.0944            'mc'         -4.4912      0.1             
    2.0944            'ml'        -0.36732      0.1             
    2.0944            'nj'           2.878      0.1   


Pawel


On 17 August 2014 16:46, Alain de Cheveigne <alain.de.cheveigne@xxxxxx> wrote:
Hi Linda,

If you follow that link there's a paragraph devoted to xlsread.

Alain


On 16 Aug 2014, at 07:32, Linda Seltzer <lseltzer@xxxxxxxxxxxxxxxxxx> wrote:

> "(see
> http://abandonmatlab.wordpress.com/2012/08/07/matlab-cant-read-plain-text-data-out-of-a-wet-paper-bag/
> for an enlighening rant)."
>
> Matlab can easily read .csv text files with the xlsread command.
>
> Matlab can read other lines of text exactly the way C language does, with
> sscanf.
>
> Linda Seltzer
> DSP Engineer - Consultant