run .exe file with matlab in unix

how can i run .exe file with matlab in UNIX. I tried as in windows:
!hyd.exe projet.csv
but i receive an error
any help?
thank you

Réponses (2)

Kawin Kumaran
Kawin Kumaran le 5 Juil 2020

0 votes

system() function is used to run executables from MATLAB .
Syntax :
system('"myexe.exe" arg0 arg1')
Please refer the following documentation for UNIX tips and Limitations :

11 commentaires

Mabrouk Abaza
Mabrouk Abaza le 5 Juil 2020
hi Kawin, system didn't work. I received this error:
/bin/bash:hyd.exe commande introuvable
It is not on your PATH environment variable. Either adjust your PATH to include the directory that the exe is in, or else specify the exact path
system('/path/to/executable/hyd.exe arg0 arg1')
Mabrouk Abaza
Mabrouk Abaza le 5 Juil 2020
i tried system('/home/mab/hyd.exe projet.csv')
i received this error:
/bin/bash:hyd.exe aucun fichier ou dossier de ce type
the file is already there
Walter Roberson
Walter Roberson le 5 Juil 2020
your system does not recognize the file as one it knows how to execute. See the answer that I posted.
Mabrouk Abaza
Mabrouk Abaza le 5 Juil 2020
i adjusted my path to include the directory that the exe is in, but i got the same error
Mabrouk Abaza
Mabrouk Abaza le 5 Juil 2020
i got this error:
/bin/bash:/home/mab/hyd.exe: cannot execute binary file : erreur de format pour exec()
Any help?
thanks
Walter Roberson
Walter Roberson le 6 Juil 2020
Linux cannot execute Windows .exe .
You have three choices:
  1. You can find a Linux version of the program. This might be difficult, as it looks to me as if the program was written in the time of DOS 3.2, if I have tracked down the right hyd.exe (not certain at all)
  2. You can install a Windows emulator such as Wine on your Linux system, and change your command line so that you invoke that emulator to run the program, such as system('wine /home/mab/hyd.exe')
  3. You can switch your OS to MS Windows
Mabrouk Abaza
Mabrouk Abaza le 8 Juil 2020
i tried the second option with wine. I got some errors like this:
fixme:advapi:RegisterTraceGuidsW
any help?
thank you
Walter Roberson
Walter Roberson le 8 Juil 2020
Mabrouk Abaza
Mabrouk Abaza le 8 Juil 2020
I used:
sudo apt install wine
Walter Roberson
Walter Roberson le 8 Juil 2020
I would tend to think that the installation instructions directly from Wine would take priority.
If you still have the problem after you have followed them, post the complete traceback; that might help narrow the problem down.
Am I correct that your hyd.exe was created many years ago, in the 1980's ?

Connectez-vous pour commenter.

Walter Roberson
Walter Roberson le 5 Juil 2020

0 votes

exe files are Windows executables that are not directly usable in Unix.
If you have a windows emulator such as wine you might be able to use that
system('wine file.exe arg0 arg1')

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by