>> h = plot((1:5).^2); %// example plot
>> get(h,'YData')
ans =
1 4 9 16 25
Or, if the axis only has that one plot, you can get its handle dynamically:
>> plot((1:5).^2); %// example plot
>> get(get(gca,'Children'),'YData')
ans =
1 4 9 16 25