When writing user defined functions how can i have a function of a variable as an input variable?
Show older comments
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 Comments
Steven Lord
on 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
on 7 Nov 2016
Edited: Jacob Carias
on 7 Nov 2016
Accepted Answer
More Answers (0)
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!