Filter löschen
Filter löschen

addressing elements in a cell aray of cells

2 Ansichten (letzte 30 Tage)
Jeff Eriksen
Jeff Eriksen am 15 Jul. 2014
Kommentiert: Jeff Eriksen am 15 Jul. 2014
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

Akzeptierte Antwort

James Tursa
James Tursa am 15 Jul. 2014
Bearbeitet: James Tursa am 15 Jul. 2014
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.

Weitere Antworten (0)

Kategorien

Mehr zu EEG/MEG/ECoG finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by