Using a function in another function
Show older comments
I'm trying to use a function in another. For example, there's a defined function:
function y=super(x)
y=x.^2;
end
and I want to use it in another:
function work(super,a,b)
%blah blah blah
end
What I tried was:
f=@super
this did not work...any advice?
2 Comments
James Tursa
on 12 Nov 2020
Please show the complete code that you tried, not just snippets. Does the super( ) function reside in a file called super.m or is it part of another file? What does the f=@super have to do with how you are calling it? Etc.
SENLIN YUE
on 13 Nov 2020
Edited: SENLIN YUE
on 13 Nov 2020
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB 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!