I created a rectangle in the UIAxes window by using
tArea = rectangle(app.UIAxes, 'Position', [25 25 50 50], 'FaceColor', [0 1 .75 .3], 'EdgeColor', [0 1 .75 .3]);
but now I want to change its position when I click a button in the app. I wanted to just use
tArea.Position = [25 30 50 50];
but I think tArea is outside the scope of the buttonClicked function. I am not sure the best way to make tArea visible to the other function in app designer. Or is there a better way to do it altogether?
Best Answer