He won a bursary to Marischal College, University of Aberdeen, and graduated MA in 1816.
He also lectured on Humanity at Marischal College who awarded him an honorary doctorate (LLD) in 1834.
His pupils included David Masson who later compared Melvin to the inspirational Thomas Arnold.
[3] Following his death he was succeeded as Rector of Aberdeen Grammar School by Sir William Duguid Geddes.
A stained glass window in the library of Marischal College is dedicated to his memory in 1885.