Azzera filtri
Azzera filtri

addressing elements in a cell aray of cells

2 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

James Tursa
James Tursa il 15 Lug 2014
Modificato: James Tursa il 15 Lug 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.

Più risposte (0)

Categorie

Scopri di più su EEG/MEG/ECoG in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by