how to run a command in power shell from Matlab

120 ビュー (過去 30 日間)
caesar
caesar 2020 年 2 月 10 日
コメント済み: Arye 2023 年 5 月 14 日
I have looked at different answers and docymentation but couldnt solve this problem. I am trying to run a command in powershell from matlab instead of doing it the ordinary way. Here is a description of what I used to do and why.
I have a Max script that initialises a camera in 3d max scene, render and save the resulted image from that camera. I , normally do the following :
1- go to the 3d Max directory.
2- Hold shift and right click , choose ' open powershell window here'.
this is the ourput
PS C:\Program Files\Autodesk\3ds Max 2019>
3- then I run this command :
.\3dsmaxcmd.exe -script "E:\Script images\model_2\pave.ms" "C:\Users\Desktop\model.max"
which is basically have two parts , path to my script pave.ms and the model model.max.
so , is there anyway i can run that from matlab and get informed when the rendering is finished ( noarmally it will be dispalyed on the powershell that the job is done? ? especially if i want to that iteratively ?
I am using Matlab 2018b on windows 10

採用された回答

Akhila Bonagiri
Akhila Bonagiri 2020 年 2 月 11 日
Open matlab command window, and type the following command
>>!powershell.
This will open power shell in interactive mode in the matlab command window. From there you can execute your powershell commands
  2 件のコメント
Seyedeh Shahrzad Mirhosseini
Seyedeh Shahrzad Mirhosseini 2020 年 3 月 9 日
Hi
I used this command but after executing my shell, matlab is just busy and is too slow. Could you help me figure out the problem?
Arye
Arye 2023 年 5 月 14 日
for me its worked but i wanted to write a script that includes in the middle of it turning on powershell bat file and than go back to matlab script, yet the matlab shows that it can't recognize the bat file inside it script.
is there a solution to use in matlab scripts parts that execute bat files?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by