When you use a string as a Callback, the string is executed in the base workspace, not in the workspace of the function that set the callback.
Also, you are trying to mix command line syntax and function syntax in your save command.
set(pbh,'Callback',@(src,evt) save('data'.txt', get(Bz_eth, 'String'), '-ascii') );
Best Answer