MATLAB: ‘subsindex’ error when setting figure position. What is going on

figureMATLAB

I am trying to resize a figure as shown
H = figure;
set(H,'Position',[200 200 800 200])
I get the error
Function 'subsindex' is not defined for values of class 'matlab.ui.Figure'.
What is going on and how can I fix this?

Best Answer

You accidentally created a variable named set so MATLAB thinks that set() expression is an attempt to index the variable.