フィルターのクリア

Argument Question?

3 ビュー (過去 30 日間)
Cote
Cote 2011 年 4 月 29 日
I have a homework assignment that says, "Your function will receive the name of the input file as an argument." I'm just a little confused on what that means. Does it means it will be something along the lines of:
function HW = load('data1.txt')

採用された回答

Sarah Wait Zaranek
Sarah Wait Zaranek 2011 年 4 月 29 日
I think this is what they meant -
In the function file:
function outputVar = myfunction(inputVar)
% write the rest of the program here, using inputVar as you would a string
When you call the function you give it a string:
thisoutput = myfunction('data1.txt')
  4 件のコメント
Cote
Cote 2011 年 4 月 29 日
Thanks a ton!
Sarah Wait Zaranek
Sarah Wait Zaranek 2011 年 4 月 29 日
Walter, yes I was doing that for clarity. I will change it to inputvar and outputvar.

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

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by