| Using the C Math Library | ![]() |
Building an Application
C source code for the example ex1.c is included in the <matlab>\extern\examples\cmath directory, where <matlab> represents the top-level directory where MATLAB is installed on your system. To verify that mbuild is properly configured on your system to create stand-alone applications, enter at the DOS prompt:
mbuild ex1.c
This creates the file called ex1.exe. Stand-alone applications created on Windows 95 or NT always have the extension .exe. The created application is a 32-bit Microsoft Windows console application. For answers to some common build problems, see Troubleshooting mbuild.
Shared Libraries (DLLs)
All the WIN32 Dynamic Link Libraries (DLLs) for the MATLAB C Math Library are in the directory
<matlab>\bin
The .def files for the Microsoft and Borland compilers are in the <matlab>\extern\include directory. Import libraries for supported compilers can be found in <matlab>\extern\lib\win32\<compiler>.
Before running a stand-alone application, you must ensure that the directory containing the DLLs is on your path. The directory must be on your operating system $PATH environment variable. On Windows 95, set the value in your autoexec.bat file; on Windows NT, use the Control Panel to set it.
Running Your Application
You can now run your stand-alone application by launching it from the command line. For example,
ex1
1 3 5
2 4 6
1.0000 + 7.0000i 4.0000 +10.0000i
2.0000 + 8.0000i 5.0000 +11.0000i
3.0000 + 9.0000i 6.0000 +12.0000i
| Configuring the Build Environment | mbuild Options | ![]() |