Not enough Input Arguments

8 ビュー (過去 30 日間)
Victor Dalosto
Victor Dalosto 2018 年 1 月 15 日
コメント済み: Victor Dalosto 2018 年 1 月 15 日
Im having problem with a script. Im trying to create a function that handles differents inputs in a GUI, convert those value, and display the result. The problem is that the script is not running the get(handles lines when its under the created function and is display the following error:
Not enough input arguments.
Error in EngineerTool1>ETConverterLenght (line 72)
LC_value1 = str2num(get(handles.LCinput,'String'));
Error in EngineerTool1>LCinput_Callback (line 134)
ETConverterLenght;
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in EngineerTool1 (line 16)
gui_mainfcn(gui_State, varargin{:});
Here is the code
function LCinput_Callback(hObject, eventdata, handles)
ETConverterLenght;
function ETConverterLenght(handles)
LC_value1 = str2num(get(handles.LCinput,'String'));
  1 件のコメント
Victor Dalosto
Victor Dalosto 2018 年 1 月 15 日
The script run just fine when it is beside the previous created function LCinput_Callback, the problem is that i cant create a function that does the same thing, and i dont know why.

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

採用された回答

Walter Roberson
Walter Roberson 2018 年 1 月 15 日
Change your line
ETConverterLenght;
to
ETConverterLenght(handles);
Note: you have used "Lenght", but most people would use "Length"
  1 件のコメント
Victor Dalosto
Victor Dalosto 2018 年 1 月 15 日
It did work. Thank you so much.

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

その他の回答 (1 件)

Matt J
Matt J 2018 年 1 月 15 日
編集済み: Matt J 2018 年 1 月 15 日
The function ETConverterLenght isn't being passed an argument in the code for this callback:
function LCinput_Callback(hObject, eventdata, handles)
ETConverterLenght;
Maybe you meant to have,
function LCinput_Callback(hObject, eventdata, handles)
ETConverterLenght(handles);

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by