How to store specific data from structure (substructure)?

2 ビュー (過去 30 日間)
kubyk
kubyk 2014 年 4 月 8 日
コメント済み: Dishant Arora 2014 年 4 月 8 日
Hi,
I have large dataset in structure arrays. Hundred of subctructures (1x100), it looks like
data = 1x100 struct array with fields:
timestamp (not interesting)
stimIndex (not interesting)
stim (not interesting)
signal (column of samples - important)
I would like to store just with signal (data(1,1).signal, data(1,2).signal....data(1,100).signal). I don´t know how to make the loop, which will store just the signal data and do it hundreds of times. 100 dataset - 100 file. I hope it is quite clear.
Many thanks for tips

採用された回答

Dishant Arora
Dishant Arora 2014 年 4 月 8 日
That is already stored but if you want it to store in another non struct variable, you need not use a loop. follow this:
Signal = {data.signal} % will result in cell array
  2 件のコメント
kubyk
kubyk 2014 年 4 月 8 日
According to your tip, I have matrix 1x100 and each element contains my signal. That is good but now I don´t know how to work with that. For example I would like to do sum of this signals (like averaging).
I thought the FOR loop will be usefull. I wanted make folder with 100 signal files and then work with signals separately.
Dishant Arora
Dishant Arora 2014 年 4 月 8 日
That results in a cell array not a matrix. You can access individual signals using:
mat = Signal{1}; % Access 1st signal
Go through the attached link to know more about cell arrays, like how to access individual element or how to operate on them http://www.mathworks.in/help/matlab/cell-arrays.html

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by