How to run an .exe file and open an input .txt file to that

16 ビュー (過去 30 日間)
ABDUL MANNAN
ABDUL MANNAN 2020 年 6 月 26 日
コメント済み: Ameer Hamza 2020 年 7 月 2 日
Hi,
i want to open .exe from matlab and then provide it with input .txt file and then give that program command to RUN the file. I have used this code but it only opens .exe file. how to give it command to open input file and then rut that file into program
FID=fopen('input.txt','wt');
fprintf(FID,strcat('RP 0 181 1 1000 -90 0 1 1','\n'));
fprintf(FID,strcat('RP 0 1 360 1000 90 01 1','\n'));
fclose(FID)
system('C:\NEC-PRO16\BIN\NECWINP.EXE')
  4 件のコメント
Walter Roberson
Walter Roberson 2020 年 7 月 2 日
I cannot find a user manual for the program.
The software appears to be more than 20 years old.
ABDUL MANNAN
ABDUL MANNAN 2020 年 7 月 2 日
編集済み: ABDUL MANNAN 2020 年 7 月 2 日
yes you are right it is an old software.
you can find it here https://www.nec2.org/

サインインしてコメントする。

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 6 月 27 日
If it accepts through command line as an input argument then you can try this
system('C:\NEC-PRO16\BIN\NECWINP.EXE input.txt')
and if it accepts it as input text, then you can use redirection
system('C:\NEC-PRO16\BIN\NECWINP.EXE < input.txt')
  8 件のコメント
ABDUL MANNAN
ABDUL MANNAN 2020 年 7 月 2 日
i mean when i run it manually by opening program and then open this file in the pogram
Ameer Hamza
Ameer Hamza 2020 年 7 月 2 日
But that does not mean that the program is able to accept the text file from the command line. It might not be supported. You need to check the documentation of the exe program to see if it accept the input arguments from the command line.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by