How to resolve the Errors regarding Undefined function 'real' for input arguments of type 'matlab.ui.Figure'.

2 ビュー (過去 30 日間)
sangram more
sangram more 2018 年 4 月 16 日
編集済み: Jan 2018 年 4 月 16 日
>> actup Undefined function 'real' for input arguments of type 'matlab.ui.Figure'.
Error in int2str (line 12) x = real(x);
if true
% code
end
Error in PlotRay (line 52) Ans = inputdlg({...
Error in PlottingTools (line 152) PlotRay([DirInfo.MainWork Def.SubDir]);
Error in AcToolboxFrontEnd (line 298) State = PlottingTools(Def, DirInfo, [], PlotToolsExitStrs);
Error in act (line 3) AcToolboxFrontEnd;
Error in run (line 96) evalin('caller', [script ';']);
Error in actup (line 3) run([cd,'\source\act']);

回答 (1 件)

Jan
Jan 2018 年 4 月 16 日

According to the error message, your x is a handle of a figure. Then real() is not defined to convert it.

If you post the related code, we might be able to see, why you assume that x has a numerical value.

  2 件のコメント
sangram more
sangram more 2018 年 4 月 16 日
編集済み: Jan 2018 年 4 月 16 日
this was the code
function s = int2str(x)
[DELETED]
% Copyright 1984-2010 The MathWorks, Inc.
[DELETED]
Jan
Jan 2018 年 4 月 16 日
編集済み: Jan 2018 年 4 月 16 日
I've removed the posted code. There is no reason to publish the copy-righted code of int2str(), but the problem is found in the code, which calls this function. Why does your code try to convert a figure handle to a string in the function PlotRay, line 52?

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

カテゴリ

Help Center および File ExchangeFunctions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by