How do I run a matlab script automatically from an excel input?
조회 수: 21 (최근 30일)
이전 댓글 표시
Hello, I'm just wondering if there is a way to do a automatically run for a matlab script from excel.It's basically I press the hyperlink or something in excel and the matlab script will pop up and run automatically in MATLAB. I'm appreciated for the help. Thank you.
댓글 수: 0
답변 (2개)
KL
2017년 8월 24일
There's nothing you can do inside Matlab to do this. Anyway, you should do it with a batch file and hyperlink that file on your excel cell.
"MATLAB PATH\matlab.exe" -nodisplay -nosplash -nodesktop -r "run('FILE PATH\Untitled4.m');"
댓글 수: 2
José-Luis
2017년 8월 24일
편집: José-Luis
2017년 8월 24일
Quoting from the documentation:
"Automation is a COM protocol that allows one application (the controller or client) to control objects exported by another application (the server). MATLAB supports COM Automation server capabilities on Microsoft® Windows® operating systems. Any Windows program that can be configured as an Automation controller can control MATLAB. Some examples are Microsoft Excel® and Microsoft Access™, and many Microsoft Visual Basic® and Microsoft Visual C++® programs."
Jan
2017년 8월 24일
A short search in the internet for "Run Matlab script from Excel" reveals:
- https://www.mathworks.com/matlabcentral/answers/303302-how-can-i-run-a-matlab-script-from-excel
- https://www.mathworks.com/matlabcentral/answers/10903-running-matlab-script-from-excel
- https://www.mathworks.com/matlabcentral/answers/52951-executing-matlab-m-script-from-excel-vba-macro
- ...
Does this help? If not, please explain which specific problems you have with it.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Use COM Objects in MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!