call my function by command line

I'm working on a MATLAB function which i want to implement on a existing GUI. Now i received the command line that should be used to call my function, but i'm not sure how to implement it in my function. The commandline looks like:
function.exe r <return directory> <seriesdirectory>
How should i start my function to make it work with this command line?

 採用された回答

Walter Roberson
Walter Roberson 2014 年 1 月 20 日

0 投票

function YourFunction( returndir, seriesdir )
and returndir and seriesdir will be strings when the function is called.
Note: you will not be able to name it "function".

3 件のコメント

Hugo
Hugo 2014 年 1 月 21 日
Thanks a lot, but i have one more question, because the seriesdir is a variable direction, which is linked to a at that moment selected data set, how do i implement this in my script?
Walter Roberson
Walter Roberson 2014 年 1 月 21 日
if .... whatever condition
seriesdir = 'forward';
else
seriesdir = 'backward';
end
YourFunction(returndir, seriesdir);
Hugo
Hugo 2014 年 1 月 22 日
Sorry i meant directory, not direction it's a variable directory so how do i call this in my function and call it from MATLAB. So when i use the suggested function, does it select the variable directories from the command line? And if it does how do i let matlab use the seriesdirectory to load my images and the return directory to save my results (i use dicomread en dicomwrite to load and save, i only need to now how to make sure it uses the directories from in the commandline)
I checked my command line and it actually looks like:
Command line: function.exe –r directory seriesdirectory -r0

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFile Operations についてさらに検索

質問済み:

2014 年 1 月 20 日

コメント済み:

2014 年 1 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by