How to use a workspace variable in editor
12 次查看(过去 30 天)
显示 更早的评论
I'm creating a function and I want to input a variable from my workspace in the function, with it being constant.
Is there a way I can "call" the variable from the workspace without having to define the variable at the beginning of the editor?
Thanks for your help
Joaquin
0 个评论
回答(2 个)
Paulo Silva
2011-2-15
Why don't you supply that variable as argument for the function when you call the function from workspace?
MyFunction(MyConstantVariable)
0 个评论
Andreas Goser
2011-2-15
I'd say you need to work with function arguments:
For the sake of completeness, the is also the EVALIN command, but I do not recommend it.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!