How do i use handles with my local function?
2 次查看(过去 30 天)
显示 更早的评论
So if i,m using a anonymous function with a ordinary equation i can write it like this.
f = @(x) x^2
and pass f(1) = 1, f(2) = 2 and so on.
But if i define a function
function return = test(x,y,z)
and want to use this function in the anonymous function, how do i write this?
f = @(x,y,z,) test ??
0 个评论
回答(1 个)
madhan ravi
2020-9-10
f = @test
f(1,2,3)
Note: Never assign a variable named as return shadows inbuilt function
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Function Handles 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!