Your warning message seems to indicate that you are using the version before Matlab R2014b.
If so, you do not have access to dot notation, because when you do ax=gca; , you get the return value of the ax that the double class has. The value is the identifier of the object descriptor (the current axis in this case), but not the descriptor itself.
When you try to execute ax.Color = 'y'; Matlab thinks that you want to overwrite your ax [double] new variable ax , which will be a structure, with the color field and give a warning.
You can access point notation for graphical objects and properties, but first you need to get a real object descriptor using the handle function. For instance:
ax = handle( gca) ; %// the value "ax" returned is an `object`, not a `double`
or even an existing link to a graphic descriptor:
ax = gca ; %// retrieve the `double` reference to the handle ... ax = handle(ax) ; %// the value "ax" returned is an `object`, not a `double`
then you can use dot notation for all public properties of the graphic. ax.Color = 'y'; must now be valid
source share