Using a function in another function
显示 更早的评论
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 个评论
James Tursa
2020-11-12
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
2020-11-13
编辑:SENLIN YUE
2020-11-13
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!