Effacer les filtres
Effacer les filtres

Argument Question?

3 vues (au cours des 30 derniers jours)
Cote
Cote le 29 Avr 2011
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')

Réponse acceptée

Sarah Wait Zaranek
Sarah Wait Zaranek le 29 Avr 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 commentaires
Cote
Cote le 29 Avr 2011
Thanks a ton!
Sarah Wait Zaranek
Sarah Wait Zaranek le 29 Avr 2011
Walter, yes I was doing that for clarity. I will change it to inputvar and outputvar.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by