How do you assign into a function space a variable that exists in the caller script?
显示 更早的评论
I have a an anonymous function that uses specific inputs. When I call the function from the caller script, I want to also pass a parameter vector into the function space. However, I can't seem to do this correctly.
I am trying this repeatedly using the "assigning" function, with various permutations of 'base' and 'caller," and can't seem to make it work.
4 个评论
Stephen23
2018-1-17
It would be simpler and more efficient to parameterize the function, rather than relying on slow and buggy assignin:
Or using nested functions:
Patrick Anderson
2018-1-17
Steven Lord
2018-1-17
If you try Stephen's and Walter's advice and it still doesn't work, I recommend showing a small segment of code to illustrate concretely what you're trying to do. Your original problem description was very general, so the advice we could give also could only be general. The more detailed and specific the description of the problem we have, the more focused our suggestions can be.
Patrick Anderson
2018-1-17
编辑:Patrick Anderson
2018-1-17
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!