How to load .prj file from windows command prompt?

Hi there,
I am new to Matlab and project files. I have to load .prj file which will generate some files for my project. I am able to load by double clicking on the .prj file from GUI but I want to load from command window. I have to write a bat file which will invoke the .prj file and load automatically.
Currently I am using this command from my windows command prompt, which will open matlab but doesn't do anything.
matlab load('D:\automation\simulink\autogen\autogen.prj').
Can anyboday please help me to resolv this issue? Thanks in advance - Kondal

 Accepted Answer

Fangjun Jiang
Fangjun Jiang on 14 May 2020
Edited: Fangjun Jiang on 14 May 2020
matlab.exe -r "open('D:\automation\simulink\autogen\autogen.prj')"

3 Comments

Kondal A
Kondal A on 14 May 2020
Edited: Kondal A on 14 May 2020
Thank you @Frangjun it worked. Whenever I want to load any .prj file, I can just run the same command by specifying the path right?
If I have to run any command after loading the .prj file, I can just simply add "/r command" in the same command right? matlab.exe -r "open('D:\automation\simulink\autogen\autogen.prj')" /r build.
You would do matlab.exe -r "statement1;statement2;statement3". But best way is to put all those statements into one .m file and then matlab.exe -r "MyScript"
You mean to say, I have to put matlab.exe -r "open('D:\automation\simulink\autogen\autogen.prj')" and "build" command into one .m file and then matlab.exe -r "script.m" right?

Sign in to comment.

More Answers (0)

Asked:

on 14 May 2020

Commented:

on 14 May 2020

Community Treasure Hunt

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

Start Hunting!