Command syntax for functions inside packages
显示 更早的评论
Matlab has a "command syntax" where if you call a function without brackets the arguments are passed as character arrays to the called function, e.g.
help topic
is interpreted as
help('topic')
But this doesn't seem to work when the function is inside a +package folder - e.g. If I have
+mypack
|--myfunc.m
and I call
mypack.myfunc some arguments
This fails with:
mypack.myfunc some arguments
↑
Error: Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets
instead of parentheses.
However, if I import the function it works fine, e.g.
import mypack.myfunc
myfunc some arguments
So the question is: Is command syntax supported for functions inside packages (without using import)? If so, how do I get it to work?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!