Is this something that happened as soon as you met this person? Like, in the days or weeks prior, were you able to masturbate and get a satisfactory erection and orgasm?
If it was sudden like that, I'd have to wonder if it's psychological. Do you have a fear of something - sexual intimacy, with this person specifically or in general?
For sure, you have to rule out physical problems first. It could be a prostate issue, low testosterone, high blood pressure, heart disease, diabetes, and about a gazillion other things, so you definitely need to see your doctor first.
Let us know what happens.