MATLAB: Running codes in mixed OS environment

Ever faced the problem of running executables in a MATLAB installation on Linux. I frequently use an executable file (.exe) provided by an eminent research lab, but the linux enthusiast that I am, shifting to Windows just for running this file is out of the question! So, how to solve this issue!

Well, you need access to either a system running Windows at your workplace, or have a virtual Windows installation in VirtualBox. Set up ssh via cygwin (refer SSH via CYGWIN) on such a system and also make sure to have a password-less SSH login enabled (refer ssh autologin) between the Linux and Windows systems.

Once this is done and given the fact that such a Windows environment is up and running, all you have to do through the MATLAB command prompt is:

system(‘ssh username@IP_of_windows command1;command2’);

where : command1 and command2 are the things you want to execute on that system. For e.g: in my scenario, i have already put the .exe (say: test.exe) in the cygwin home folder (C:/cygwin/home/<username>/) on the Windows system. Now, i just run:

system(‘ssh username@IP_of_windows ./test.exe’);

You can use few more ssh/scp via system command calls in MATLAB to copy back & forth the data. Thats it!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s