Deal with Closed MATLAB Executable and Windows command line

조회 수: 9 (최근 30일)
michael
michael 2024년 3월 26일
편집: Fangjun Jiang 2024년 3월 26일
I was provided a closed matlab code (exe) built by matlab application. When I ran it, I see that there are some UI with some input parameters and some output parameters. I'd like to send some inputs from windows command line and get the output.
I've tried to do so by
my_app_name input1 input2 ...
, but i'm getting an error like: The input to str2func "input1" is not valid funciton name.
I guess that the function which shall be called is func2 with those input parameters.
How can I do this?
  댓글 수: 3
michael
michael 2024년 3월 26일
편집: michael 2024년 3월 26일
I wish I had. He refuses to do so
Mario Malic
Mario Malic 2024년 3월 26일
편집: Mario Malic 2024년 3월 26일
Well, input1 and input2 should be existing functions. If you want to use the functions that are within the executable, then you should know their names.
I don't know much about what could you do, other than waste your time by trying to figure out what is inside the program.
This what I am going to write may not help, but try supplying this as an input, maybe it'll lead you somewhere.
eval("whos")

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

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2024년 3월 26일
편집: Fangjun Jiang 2024년 3월 26일
Based on the error message, it seems that "input1" is passed to the app when you run it in command line
my_app_name input1 input2 ...
which is really good. It indicates that the app is designed to run interactively as well as through API.
What happens if you run str2func('input1') in MATLAB Command Window? Did you provide a valid 'input1', such as
str2func('abs')
ans = function_handle with value:
@abs

제품


릴리스

R2013b

Community Treasure Hunt

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

Start Hunting!

Translated by