usually its done using the MCC compiler command.. its of the form
mcc -m filename.m
and there are more options for converting using mcc command. u must have a built in compiler.. matlab if u have it intalled.. it s explained in matlab documentation. u could seek the matlab help also for getting it! i dont have an example for u as of now as i dont have a compiler installed.. wiull post it soon.. but the link i gave above could be useful i think, as if contains examples.