Constant already used When creating function handle

1 回表示 (過去 30 日間)
Gavin Seddon
Gavin Seddon 2016 年 5 月 18 日
コメント済み: Steven Lord 2016 年 5 月 18 日
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

採用された回答

Walter Roberson
Walter Roberson 2016 年 5 月 18 日
If fun is already a function handle, then you can try
x = fun;
or
x = @(varargin) fun(varargin{:})
  4 件のコメント
Gavin Seddon
Gavin Seddon 2016 年 5 月 18 日
Yes this works fine and generates a new X handlehowever I get a simple error when I try to use fplot. To related and may I plot this handle?
Steven Lord
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 ExchangeControl Flow についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by