Date: Mar 27, 2013 5:26 PM
Author: Steven Lord
Subject: Re: figure(2) doesn't work in -nodesktop mode

<> wrote in message
> The behavior of the "figure" command seems to work differently when using
> Matlab in a shell (-nodesktop mode). I can't create new figures from the
> command line. If I type

> I get the error:
> Index Exceeds Matrix Dimensions.

That suggests that you've created a variable named figure and that variable
has fewer than 2 elements, or that you've written your own figure function
that's shadowing the built-in FIGURE function and somewhere in your figure
function you're accessing an element beyond the element of an array. If you
copied and pasted the message _exactly_ from your Command Window I suspect
the latter [shadowing the FIGURE function] case more strongly, as the casing
of the message you posted doesn't match the casing of the message I would
expect from the former [variable] case.

To resolve the former, CLEAR the variable and modify your code so you don't
create such a variable again. To resolve the latter, rename your figure

Steve Lord
To contact Technical Support use the Contact Us link on