Constant already used When creating function handle
조회 수: 1 (최근 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!