addressing elements in a cell aray of cells

1 次查看(过去 30 天)
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