You shouldn't be using a fig file. Build the interface from code.
Apart from that point you should be able to convert every m file to an executable, but not all functions support code generation.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!