フィルターのクリア

Using function syntax with stand alone executables

2 ビュー (過去 30 日間)
David H
David H 2019 年 1 月 15 日
編集済み: David H 2019 年 1 月 15 日
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?

回答 (1 件)

David H
David H 2019 年 1 月 15 日
編集済み: David H 2019 年 1 月 15 日
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.

カテゴリ

Help Center および File ExchangeScripts についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by