How to store specific data from structure (substructure)?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
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
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 Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!