Undefined function 'plus' for input arguments of type 'matlab.ui.Figure'.
古いコメントを表示
I get this error message when I run a script that was given to me on my data and may well have been written in an earlier version - I am working 2014b.
Any ideas? This is the full error message, but I haven't copied the script in as it's really quite long.
Undefined function 'plus' for input arguments of type 'matlab.ui.Figure'.
Error in PRL_analyseData>getNewFig (line 538) hfig = varargin{1}+1;
Error in PRL_analyseData (line 160) hfig = getNewFig(hfig,cmap);
1 件のコメント
Adam
2014 年 10 月 7 日
You probably need to rework the script to use an array of figure objects rather than doing maths on the old handles to refer to presumably the next figure.
採用された回答
その他の回答 (2 件)
Daisy
2014 年 10 月 8 日
4 件のコメント
Guillaume
2014 年 10 月 8 日
Please, reply in comments rather than starting a new answer.
This has nothing to do with 2014b. vline is not a function that ships with matlab. Most likely it came from the file exchange
Daisy
2014 年 10 月 8 日
Daisy
2014 年 10 月 8 日
Guillaume
2014 年 10 月 8 日
Please, find the reply as a comment to my answer rather than here.
An updated answer to this is to overload the 'plus' function. It seems that matlab calls the builtin for inline operators by default, even if the overload doesn't pay any attention to the rules for overloading a function. I have no idea why this is though, as overloading other critical functions like sprintf seems to cause a world of pain.
Regardless of the reason, this oddity means the following function can be placed anywhere in your path, and it will only be called if the regular plus function can't handle the inputs, so it doesn't impact normal behavior or performance.
function out = plus(A,B)
try
out = double(A) + double(B)
catch
%Fail with the built-in
builtin('plus',A,B)
end
カテゴリ
ヘルプ センター および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!