You cannot use gcadirectly as if it were a reference to a descriptor on the left side of an assignment operation. You can use the syntax set(gca, ...)or ax = gca; ax.XTick ..., but only if you avoid the syntax gca.Whatever = ...that breaks down gcain the workspace that you do due to the identifier being obscured.
Syntax
gca.XTick = [0, 6, 12, 18, 24];
, . gca() gca , XTick. , gca, gca , clear ( " ll ).
ax = gca;
ax.XTick = [0, 6, 12, 18, 24];
, gca.XTick = ... .
, Matlab " ": (, set(gca, 'XTick', ...)), , lvalue , .
, gca =, .
whos which. , which, , gca.
function darnit_gca()
disp('gca is:');
which gca
subplot(2, 1, 1);
gca.XTick = [0, 6, 12, 18, 24];
subplot(2, 1, 2);
gca.XTick = [0, 6, 12, 18, 24];
disp('now gca is:');
which gca
darnit_gca, gca , lvalue.
>> darnit_gca
gca is:
built-in (/Applications/MATLAB_R2014b.app/toolbox/matlab/graphics/gca)
now gca is:
gca is a variable.