newbie and cs-list

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

newbie and cs-list

Pierrick Hanlet
Hi,
I have a matlab data file that was generated by a colleague.  The structure is as follows:
>> ConvertedData
ConvertedData =

  scalar structure containing the fields:

    FileName = HTSDAQ_180208_103412.tdms
    FileFolder = H:\04-Experiments\CTR_commisioning
    SegTDMSVerNum =

       4713
       4713

    NumOfSegments =  2
    Data =

      scalar structure containing the fields:

        Root =

          scalar structure containing the fields:

            Name: 1x4 sq_string
            Property: 1x2 struct

        MeasuredData =

          1x16 struct array containing the fields:

            Name
            Data
            Total_Samples
            Property


I can see the names clearly:
>> ConvertedData.Data.MeasuredData.Name
ans = Root
ans = AI Channels
ans = AI Channels/U1_L1
ans = AI Channels/U1_U5
ans = AI Channels/U5_L5
ans = AI Channels/L5_L1
ans = AI Channels/U01_U1
ans = AI Channels/U02_U1
ans = AI Channels/L1_L03
ans = AI Channels/L1_L01
ans = AI Channels/RVT11
ans = AI Channels/HP01
ans = AI Channels/HP02
ans = AI Channels/HP05
ans = AI Channels/PSUV
ans = AI Channels/PSUI

What I really want is to look at the data in "AI Channels/RVT11".  However,
I don't know how to index
ConvertedData.Data.MeasuredData.Data to select
only the sample of interest.  Every time I attempt to do so yields the error
message:
>> ConvertedData.Data.MeasuredData.Data(9)
error: a cs-list cannot be further indexed


My matlab colleagues cannot help me.
Thank you,
Pierrick

--


-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: newbie and cs-list

Ian McCallion
Try

  [ConvertedData.Data.MeasuredData.Data](9) 

Or  

  {ConvertedData.Data.MeasuredData.Data}{9}

The point is a cs-list is a comma-separated list of values so you have to put it somewhere that can hande that. Surrounding it with square brackets or braces makes it something you can work with.

Cheers... Ian

On 8 February 2018 at 12:26, Pierrick Hanlet <[hidden email]> wrote:
Hi,
I have a matlab data file that was generated by a colleague.  The structure is as follows:
>> ConvertedData
ConvertedData =

  scalar structure containing the fields:

    FileName = HTSDAQ_180208_103412.tdms
    FileFolder = H:\04-Experiments\CTR_commisioning
    SegTDMSVerNum =

       4713
       4713

    NumOfSegments =  2
    Data =

      scalar structure containing the fields:

        Root =

          scalar structure containing the fields:

            Name: 1x4 sq_string
            Property: 1x2 struct

        MeasuredData =

          1x16 struct array containing the fields:

            Name
            Data
            Total_Samples
            Property


I can see the names clearly:
>> ConvertedData.Data.MeasuredData.Name
ans = Root
ans = AI Channels
ans = AI Channels/U1_L1
ans = AI Channels/U1_U5
ans = AI Channels/U5_L5
ans = AI Channels/L5_L1
ans = AI Channels/U01_U1
ans = AI Channels/U02_U1
ans = AI Channels/L1_L03
ans = AI Channels/L1_L01
ans = AI Channels/RVT11
ans = AI Channels/HP01
ans = AI Channels/HP02
ans = AI Channels/HP05
ans = AI Channels/PSUV
ans = AI Channels/PSUI

What I really want is to look at the data in "AI Channels/RVT11".  However,
I don't know how to index
ConvertedData.Data.MeasuredData.Data to select
only the sample of interest.  Every time I attempt to do so yields the error
message:
>> ConvertedData.Data.MeasuredData.Data(9)
error: a cs-list cannot be further indexed


My matlab colleagues cannot help me.
Thank you,
Pierrick

--


-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------




-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: newbie and cs-list

Sebastian Schöps
In reply to this post by Pierrick Hanlet
Pierrick Hanlet wrote

> Ican see the names clearly:
>  >> ConvertedData.Data.MeasuredData.Name
> ans = Root
> ans = AI Channels
> ans = AI Channels/U1_L1
> ans = AI Channels/U1_U5
> ans = AI Channels/U5_L5
> ans = AI Channels/L5_L1
> ans = AI Channels/U01_U1
> ans = AI Channels/U02_U1
> ans = AI Channels/L1_L03
> ans = AI Channels/L1_L01
> ans = AI Channels/RVT11
> ans = AI Channels/HP01
> ans = AI Channels/HP02
> ans = AI Channels/HP05
> ans = AI Channels/PSUV
> ans = AI Channels/PSUI
>
> What I really want is to look at the data in "AI Channels/RVT11". However,
> I don't know how to index ConvertedData.Data.MeasuredData.Data to select
> onlythe sample of interest.  Every time I attempt to do soyields the error
> message:
>  >> ConvertedData.Data.MeasuredData.Data(9)
> error: a cs-list cannot be further indexed

I'd say you need
> ConvertedData.Data.MeasuredData(9).Name
or
> ConvertedData.Data.MeasuredData(9).Data

Best
Sebastian



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------