how to convert .m from windows to linux executable file?

I am working on matlab in windows OS. I am using h5 files and creating some images. I want to create an executable file from my .m script that can be run on a linux redhat. Thank you

 채택된 답변

Kojiro Saito
Kojiro Saito 2017년 7월 12일

3 개 추천

Convert to execution file from m file, you have 2 options.
MATLAB Compiler convert MATLAT scripts to execution file (if Windows) and .sh file (if Linux).
MATLAB Runtime (no-cost) is necessary for running. You need to compile on Linux when you want to create standalone execution file for Linux. Supported functions by MATLAB Compiler is in this link.
MATLAB Coder converts MATLAB scripts to C code so you can create execution file. Some functions are not supported C code generation, so please refer to this link.

댓글 수: 4

hello sir..Thank you for the reply I tried Matlab Compiler which created an executable file for my program. But I am facing a problem. I cant make any changes in my executable file. I want to use my file name(.h5 file,which I am using as input file) in the title of the figures. File name contains date and time and it changes as a new file arrives. Basically, I need to use a different file everytime(with the same structure). What I am doing right now is renaming the files with a specific name e.g. source.h5 so that I need not to change my program everytime. Please tell me how can i save the filename(specifically date & time) to use in my program Thank you
Walter Roberson
Walter Roberson 2019년 8월 6일
편집: Walter Roberson 2019년 8월 6일
Antonio Adaldo comments to Kojiro Saito:
The answer seems to neglect that the user is planning to use the executable on a different platform than the one it was created with. I seem to remember that this workflow is not possible: https://uk.mathworks.com/matlabcentral/answers/13054-compile-for-linux-on-a-windows-machine
Antonia, Kojiro specifically said,
"You need to compile on Linux when you want to create standalone execution file for Linux."
and then gave the alternative of generating C code using MATLAB Coder. The generated C code could be compiled on a Linux system.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

질문:

2017년 7월 11일

댓글:

2019년 8월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by