Constant already used When creating function handle
3 次查看(过去 30 天)
显示 更早的评论
I am trying to create a handle for a Function, I received two errors:
Error:
Expression or statement is incomplete or incorrect.
Error: "p1" was previously used as a variable, conflicting with its use here as the name of a function or command.
I am attempting to create a new function handle for an existing function created using the curve fit tool.
The syntax I use is
x = @fun;
will someone please correct this command?
Gav
0 个评论
采纳的回答
Walter Roberson
2016-5-18
If fun is already a function handle, then you can try
x = fun;
or
x = @(varargin) fun(varargin{:})
4 个评论
Steven Lord
2016-5-18
Please show a SMALL, self-contained example (that people can execute as part of their investigation) and the FULL text of the error message you receive when you execute that self-contained example.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Control Flow 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!