When writing user defined functions how can i have a function of a variable as an input variable?
Afficher commentaires plus anciens
I am trying to write a function for example: function res = MyFunction(x1,x2,x3,f)
where f is a function of x but Matlab doesn't seem to like this. Is there a way around this without previously defining a function?
2 commentaires
Steven Lord
le 7 Nov 2016
Can you show a little more context, like how you define the variables x1, x2, x3, and f with which you call MyFunction and what exactly "Matlab[sic] doesn't seem to like this" means?
- Does it throw an error, and if so what is the full text of the error message?
- Does it issue a warning, and if so what is the full text of the warning message?
- Does it return a result different than what you expect?
- Does it do something else (and if so, what does it do?)
Jacob Carias
le 7 Nov 2016
Modifié(e) : Jacob Carias
le 7 Nov 2016
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Image Arithmetic dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!