If it's the image size, you can do
[rows, columns, numberOfColorChannels] = size(rgbImage);
If it's the size of the axes in the units you plotted, you can use
This will give you the min and max value that is displayed for each axis direction.
If it's the size of the graph in screen units, use
ax = gca;
rect = ax.Position;