MATLAB Answers

'subsindex' error when setting figure position. What is going on?

11 views (last 30 days)
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?

  0 Comments

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 22 Sep 2016
You accidentally created a variable named set so MATLAB thinks that set() expression is an attempt to index the variable.

  3 Comments

Udit Gupta
Udit Gupta on 22 Sep 2016
Thanks! Let's not call it an accident and call it as it is - a stupid decision.
William Chamberlain
William Chamberlain on 22 Oct 2018
Worked for me: I had managed to create a variable named 'axes' which was giving me problems with
sub_axis_h(3) = subplot(2,2,3);
axes(sub_axis_h(1)); hold on; grid on; xlabel('x'); ylabel('y');

Sign in to comment.

More Answers (0)

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!