A melodic minor scale in a given key is similar to the Natural minor scale in the same key, except that both the 6th and 7th notes are raised by 1 half-tone / semitone to arrive at the melodic minor scale.
The melodic minor scale uses the W-H-W-W-W-W-H note counting pattern to identify the scale note positions.
The first note in the diagram below (*) is the tonic note, from which the counting pattern begins.
To count up a Whole tone, count up by two physical piano keys, either white or black.
To count up a Half-tone (semitone), count up from the last note up by one physical piano key, either white or black.
So in the example below, we are interested in the melodic minor scale in the key of E-flat.
The 8th and final note in the diagram is the octave note, named the same as the tonic note, and is the note where the scale and tone / half-tone pattern rule starts repeating all the way up the piano keyboard.
Be aware that when descending this scale, sometimes the notes of the Eb natural minor scale are played instead.
To understand the frequency relationship between a tonic and its octave note, have a look at the Chromatic scale overview.
The example below, Eb melodic minor scale, uses the key of E-flat.
The All melodic minor scales page contains piano diagrams and key signatures for all melodic minor scales.