Reputation: 41
I have a matlab compiled Windows executable (my_matlab_app.exe) I would like to send matlab data (arrays of numbers) directly from this executable to the MATLAB application workspace itself.
Is this possible?
It would be similar to this [http://www.codeproject.com/Tips/535390/Write-to-Excel-Sheet-through-Matlab]
Upvotes: 2
Views: 69
Reputation: 3674
For small amounts of data, you can do something like this:
matlab /r "x=2;myscript"
This starts an instance of MATLAB, sets the value of x
to 2
, and then runs myscript
which can use the value of x. For larger data sets, this is probably not practical...I would recommend saving the data in your compiled application to a .mat file ( myfile.mat
) file, and then using the command line syntax to load it:
matlab /r "x = load myfile.mat"
You can execute these commands from your compiled application as system calls:
result = system ('matlab /r "x = load myfile.mat"')
Upvotes: 2