From: Priyanshu Agarwal on

Setting of current character for a figure is not allowed. It results in the following error.

??? Error using ==> set
Bad property value found.
Object Name : figure
Property Name : 'CurrentCharacter'.

"Matt Fig" <spamanon(a)yahoo.com> wrote in message <hrvqoa$4rp$1(a)fred.mathworks.com>...
> So set it after it is read, like I showed above. Use an IF statement, or a SWITCH, so that only the allowed keys make the robot move.
>
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> switch double(get(gcf,'currentch'))
> case 28 % left arrow
> % move left
> case 29 % right arrow
> % move right
> case 30 % up arrow
> % move up
> case 31 % down arrow
> % move down
> otherwise
> end
>
> set(gcf,'currentch','3') % or whatever, as long as it will go to OTHERWISE.
> drawnow % Flush the event queue.
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
From: Walter Roberson on
Priyanshu Agarwal wrote:
>
> Setting of current character for a figure is not allowed. It results in
> the following error.
>
> ??? Error using ==> set
> Bad property value found.
> Object Name : figure
> Property Name : 'CurrentCharacter'.

It said bad property value, not that it was unwritable. What were you
trying to set it to?
From: Priyanshu Agarwal on
Thanks Walter. It's working now.

Walter Roberson <roberson(a)hushmail.com> wrote in message <a1MEn.93$7d5.32(a)newsfe17.iad>...
> Priyanshu Agarwal wrote:
> >
> > Setting of current character for a figure is not allowed. It results in
> > the following error.
> >
> > ??? Error using ==> set
> > Bad property value found.
> > Object Name : figure
> > Property Name : 'CurrentCharacter'.
>
> It said bad property value, not that it was unwritable. What were you
> trying to set it to?
From: Priyanshu Agarwal on
Thanks Walter. It's working now.

Walter Roberson <roberson(a)hushmail.com> wrote in message <a1MEn.93$7d5.32(a)newsfe17.iad>...
> Priyanshu Agarwal wrote:
> >
> > Setting of current character for a figure is not allowed. It results in
> > the following error.
> >
> > ??? Error using ==> set
> > Bad property value found.
> > Object Name : figure
> > Property Name : 'CurrentCharacter'.
>
> It said bad property value, not that it was unwritable. What were you
> trying to set it to?