I would like to create annotation objects in a functions local workspace, where object names are created in a loop.
here is how I would like to code to look:
x_ini = 0.27;
dummy = annotation(f,'textbox','EdgeColor', 'white', ...
'String',mycell(:,k),'Position',[x_ini 0.34 0.11 0.15],...
x_ini = x_ini+ 0.08;
assignin('??ws??',['h_ann_' num2str(k)], dummy)
When I use eval, this error pops: attempt to write a variable to a static workspace.
With evalin or assingin, I cannot find how to name the functions local workspace. opening up the loop works, however it is ugly: h_ann1 = ... h_ann2 = ...
Thanks in advance, Muge