So I created a MATLAB program to detect the frequencies present in a piano recording. Now I need to convert these detected frequencies to their corresponding piano note.

I know there's a theory about using A4 (440Hz) as the reference note and deriving the rest based on that. But I'm looking for something like a look up table, where I can directly call the respective piano notes by looking at the look up table. I'm not quite sure how to go on about it though and so would like some suggestions on what I could do... Thanx