Argument Question?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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')
0 Kommentare
Akzeptierte Antwort
Sarah Wait Zaranek
am 29 Apr. 2011
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 Kommentare
Sarah Wait Zaranek
am 29 Apr. 2011
Walter, yes I was doing that for clarity. I will change it to inputvar and outputvar.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Whos finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!