For interactive use of the graph, consider use of the datatips functionality. In R2018 and above, if you hover your cursor over the year/point of interest and click, you'll see a datatip show up with the info you want. For earlier releases, there's a toolbar button called "Datatips" that you can switch on to make the cursor do the same thing. You can drag it around to different values or switch between plots.
There's a picture about halfway down: https://www.mathworks.com/help/matlab/ref/matlab.graphics.datatip.datatip.html
If you really want an access/report function, consider something like the function below. You'd have to call it each time and pass in the data from the plot. The first argument is the year of interest, followed by the data.
function reportVal(year, YearVals, MaleVals, FemaleVals)
ix = find(YearVals == year);
M = MaleVals(ix);
F = FemaleVals(ix);
fprintf('Year: %u\n', yr);
fprintf('Year not found.\n')