Using function syntax with stand alone executables

3 views (last 30 days)
If I generate a stand alone executable, lets call it myfun.exe, can I call this using the function rather than command syntax?
In matlab I would call call
myfun('input_files', { 'some_path', 'some_other_path'})
But if I call the executable from the command line, I only know how to use the command syntax and if I write
myfun.exe / input_files { 'some_path', 'some_other_path'}
It just assumes the second argument is a string.
Is there anyway to make it not interpret this as a character vector, or use the command syntax for the executable?

Answers (1)

David H
David H on 15 Jan 2019
Edited: David H on 15 Jan 2019
Having looked through all the answers to do with this, it appears it is just truly awful. I'm tempted to make a wrapper of the function of the form
Function Myfun_wrapper(in_string)
eval(strcat('myfun',in_string))
and just compiling that.
The only other alternative is to have something parse all the arguments, which could be specified using either syntax (so could be numerical arrays, or cell arrays, or structs OR character arrays which if evaluated as eval(['input=',input]) would give those things). This is just terrible.
Is there even a way to tell if a function was called with the function syntax or the command syntax? It would make this much easier.

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!