MATLAB: Make an exception in ytickformat

exceptionytickformat

I would like to specifiy the number of digits in the tick labels of an axis but keeping 0 as it is.
For instance, in the following example:
x = rand(30,1);
y = rand(30,1);
scatter(x,y);
ytickformat('%.2f')
Is it possible to keep 0 unchanged, instead of 0.00?
Thanks

Best Answer

x = rand(30,1);
y = rand(30,1);
scatter(x,y);
ytickformat('%.2f')
% get all the labels
yt=yticklabels;
% replace the first one with 0, and leave the rest alone
yticklabels(['0' ;yt(2:end)])