Compiling the m-file means we convert the source code of matlab into executable file, so the other computer can run it although there is no matlab software being installed. Of course if the computer which run the application has matlab software we don’t need to compile it.
Because there are a lot of file which build matlab-based application, we must prepare them first. Application with Graphic User Application (GUI) need at least two files: the fig-file for interface and m-file for source code. If you use some toolbox on it, you must include that files to your deployment project. For example, if you create fuzzy-based application, you mast include the fis-file to your deployment project.
Let’s open your matlab software and I suggest you to change the current directory into the same directory as your programming file. Matlab provide project for compiling by clicking the file, new and deployment project in the menu bar. This figure shows you deployment project window.
Please try to compile your own matlab application. As an information, matlab use Matlab Compile to C (mcc) to convert code in matlab into c++ first before converting to exe.