Deal with Closed MATLAB Executable and Windows command line

9 次查看(过去 30 天)
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 个评论
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