I have something like this:
p = plot([0 1], [0 1], [1 2], [1 2]);
I want to take each pair and append another number.
x = get(p, 'XData');
y = get(p, 'YData');
x1 = mat2cell([x{1} double(2)]);
y1 = mat2cell([y{1} double(2)]);
x2 = mat2cell([x{2} double(3)]);
y2 = mat2cell([y{2} double(3)]);
set(p, 'XData', [x1; x2], 'YData', [y1; y2]); % this does not work
drawnow;
'get' is giving me some data in a format and I am 'set'-ing back in the same format the data with one more value for each pair.
The error I get is: Conversion to double from cell is not possible.