MATLAB: How to draw shapes in uiaxes on app designer

app designershape

I need to put a square in the middle of my 100×100 uiaxes on app designer. I tried using
rectangle(‘Position’,[25,25,50,50])
But that just creates a new window when I click run. The shape needs to be in the axes.

Best Answer

Hello, try to use
rectangle(app.UIAxes, 'Position', [25,25,50,50])