cell array saved in appdata

1 view (last 30 days)
Tyler
Tyler on 4 Apr 2014
Commented: Tyler on 5 Apr 2014
Is there a way to directly access and edit specific cells in a cell array using appdata?
setappdata(gcf, 'pipe_system', cell(10));
I would like to update specific cells in 'pipe_system'
setappdata(gcf, 'pipe_system{1,1}', cell(10));
I tried using this but it says 'pipe_system{1,1}' is an invalid field name.

Accepted Answer

Jan
Jan on 4 Apr 2014
There is no magic access. Keep it simple:
data = cell(10,10);
setappdata(gcf, 'pipe_system', data);
...
data = getappdata(gcf, 'pipe_system');
data{1,1} = rand;
setappdata(gcf, 'pipe_system', data);
This might look less convenient, but it is direct and efficient.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!