Implement a C Shared Library with a Driver Application
This example shows how to call a C shared library built with MATLAB® Compiler SDK™ from a C application.
Create the C shared library mentioned in the example see Create a C Shared Library with MATLAB Code.
Copy and paste this file in the
for_testingfolder created when you generated the C shared library.
Use the system command line to navigate to the
To compile and link the application, use
mbuildat the system command line.
mbuild matrix.c libmatrix.lib
.libextension is for Windows®. On Mac, the file extension is
.dylib, and on UNIX® it is
From the system command prompt, run the application.
matrixThe sum of the matrix with itself is: 2.00 8.00 14.00 4.00 10.00 16.00 6.00 12.00 18.00 The product of the matrix with itself is: 30.00 66.00 102.00 36.00 81.00 126.00 42.00 96.00 150.00 The eigenvalues of the original matrix are: 16.12 -1.12 -0.00