MATLAB: How to transform this code to guide

app designerguide

in order to allow to an app crated using appdesigner to save the results to workspace i did this
prompt = {'Choose the output (matrix) name'};
answer=inputdlg(prompt);
try
if ~isempty(answer{1})
assignin('base',answer{1},Bd1 );
end
catch
end
the question is if i want to create a boutoun which do the same thing but this time using guide and not appdesigner what shoud i change ?