Error: File: cftool.m Line: 355 Column: 33 Unexpected MATLAB operator

I recently downloaded and installed the curve fitting toolbox. When I open the toolbox in Matlab (by typing cftool), there is an error.
??? Error: File: cftool.m Line: 355 Column: 33 Unexpected MATLAB operator.
Line 355 of the cftool.m file is: function adjustLayout2Callback( ~, ~ )
Does anybody know how I can solve this error?

回答 (2 件)

Robert Cumming
Robert Cumming 2011 年 4 月 11 日

1 投票

What version of Matlab do you have?
I'm guessing its R2008b or earlier?
If I recall thats when the ~ was introduced to replace unused input/output arguments.
It looks like the cftool you have downloaded is for a more recent version.

3 件のコメント

Nathalie
Nathalie 2011 年 4 月 11 日
Thanks for the answer.
I'm using R2009a.
And now I see, the version I've downloaded is R2010a.
Do you know if it is possible to make it work, or not?
Robert Cumming
Robert Cumming 2011 年 4 月 11 日
dont know - check release notes to see whats updated (I dont have 2010).
Walter Roberson
Walter Roberson 2011 年 4 月 11 日
The toolbox versions must match the base software version.

サインインしてコメントする。

Matt Fig
Matt Fig 2011 年 4 月 11 日

0 投票

All that those tildes mean is the input arguments are not used in the function. Try changing the code to this:
function adjustLayout2Callback(varargin)
If you get a function like this:
function func(A,~,H)
just replace the ~ with 'junk' (no quotes of course.)
Also, for output arguments, you will sometimes see:
[~,I] = sort(A);
You can replace this with:
[I,I] = sort(A);
or,
[junk,I] = sort(A);

カテゴリ

ヘルプ センター および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

質問済み:

2011 年 4 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by