필터 지우기
필터 지우기

addressing elements in a cell aray of cells

조회 수: 2 (최근 30일)
Jeff Eriksen
Jeff Eriksen 2014년 7월 15일
댓글: Jeff Eriksen 2014년 7월 15일
I cannot figure out how to address and replace individual elements of the inner cell array in the following toy example:
sub(1,:) = {'Jeff',{'eeg1','eeg2'}}; % sets up a cell array with string and an embedded CA
new(1,:) = sub(1,:) % make a copy
new{1,2}(2) = cell('eeg3') % attempt to change one value
Error using cell Conversion to cell from char is not possible.
Error in test_cell (line 27) new{1,2}(2) = cell('eeg3')
I also tried with out the cell() and it still complains. Thanks, -Jeff

채택된 답변

James Tursa
James Tursa 2014년 7월 15일
편집: James Tursa 2014년 7월 15일
Not sure what your actual desired outcome is, but this syntax works to replace the 'eeg2' with 'eeg3':
new{1,2}(2) = {'eeg3'}
If that is not the outcome you want, please post exactly what you want the result to be and we can help with the syntax.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by