Deal with Closed MATLAB Executable and Windows command line

3 views (last 30 days)
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 Comments
Mario Malic
Mario Malic on 26 Mar 2024
Edited: Mario Malic on 26 Mar 2024
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")

Sign in to comment.

Answers (1)

Fangjun Jiang
Fangjun Jiang on 26 Mar 2024
Edited: Fangjun Jiang on 26 Mar 2024
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

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2013b

Community Treasure Hunt

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

Start Hunting!