-
C/C++ and Matlab?
Hi everyone. I have always wanted to execute a C/C++ code for use in simulation and outputting the data in a file. Then, afterwards execute an M-file in matlab to plot the said data. I was wondering is it possible for C/C++ to instantiate a command prompt and execute a batch file after the end of execution? Or do anyone know of ways to integrate C/C++ with matlab? The reason I want to use Matlab is because its so much easier to use for plotting data. Is there a C/C++ equivalent? Thanks!
-
1) The means of instantiating a command prompt and executing a batch file are both operating system and compiler dependent (in terms of how you do it from C/C++, what command processor is launched, and how you specify the script). Under most windows compilers, the system() function will be a place to start.
2) Mathworks (the mathworks vendor) provide a means of executing C and Fortran functions from matlab. Look up MEX-files in the mathworks documentation for discussion of one approach.
3) There are plotting and graphics libraries for C/C++. Again, these are compiler and operating system dependent.
-
Thanks! I think the second option is the best way. Its just so much easier to use matlab to plot, so I'm goign to avoid the third suggestion.