Outputs of a function
Mostra commenti meno recenti
Hello! I'm currently writing functions that take input, and need to return a ouput to be used by a later function. However, in the function programming, I know that I have many different variables that I'm defining in order to do the function that I need. So when I try to get the function to do an output argument (i.e. X = function(input);), it gives me the error that I have too many output arguments.
Is there a way that I can label (inside the function itself) the one ouput I want so that it only sees that variable as the correct output?
Risposta accettata
Più risposte (1)
Jaden
il 26 Giu 2012
1 Commento
Walter Roberson
il 26 Giu 2012
Any variable whose name does not appear on the left side of the "function" statement (and which is not a global or nested variable) will be deleted when the function exit, so it is not a problem to create as many variables as you need to calculate the values that you want to return.
Categorie
Scopri di più su Fit Postprocessing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!