Getting error in my GUI when I run it
古いコメントを表示
I'm trying to run my GUI, but I get the error:
The class handle has no Constant property or Static method named 'mcub'.
Error in interfaz_parte3_1>calcular_Callback (line 173)
y=str2num(get(handle.mcub,'string'));
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in interfaz_parte3_1 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)interfaz_parte3_1('calcular_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
I think is the way I'm introducing vectors.
This is part of my code:
% --- Executes on button press in calculate.
function calcular_Callback(hObject, eventdata, handles)
% hObject handle to calcular (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
costo=str2double(get(handle.costo,'string'));
y=str2double(get(handle.mcub,'string'));
x=str2double(get(handle.semanas,'string'));
CO=str2double(get(handle.bodega, 'string'));
where "y" and "x" are introduced as vectors (numbers) in an Edit box.
What is wrong with the vectors? How do I have to introduce them, or what do I have to change in the code so it can be read and used in the code as an input of a vector of numbers.
e.g. input=[1 2 3 4]
6 件のコメント
JESUS DAVID ARIZA ROYETH
2018 年 5 月 3 日
Cristina puedes adjuntar tus archivos? can you attach your files?
if you want to read vectors in an Editbox use "str2num" instead of "str2double" / si quieres leer vectores en un Editbox utiliza "str2num" en vez de "str2double" :
cost=str2num(get(handle.cost,'string'));
y=str2num(get(handle.mcub,'string'));
x=str2num(get(handle.semanas,'string'));
CO=str2num(get(hObject, 'string'));
Jan
2018 年 5 月 3 日
Please post the complete error message.
Cristina Ortiz
2018 年 5 月 3 日
編集済み: Cristina Ortiz
2018 年 5 月 3 日
Jan
2018 年 5 月 3 日
This is a rare example of a useless error message. It does neither tell in which line the error occurs, nor what the problem is. Are you sure that there are not more details?
Please tell us, when the error occurs. What do you do before?
Cristina Ortiz
2018 年 5 月 3 日
編集済み: Walter Roberson
2018 年 5 月 3 日
Cristina Ortiz
2018 年 5 月 3 日
編集済み: Cristina Ortiz
2018 年 5 月 3 日
採用された回答
その他の回答 (1 件)
DINESH KUMAR M
2021 年 3 月 28 日
Unable to resolve the name vision.CascadeObjectDetector.
Error in main>BR_OWSE_Callback (line 647)
fd = vision.CascadeObjectDetector();
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in main (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)main('BR_OWSE_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating Menu Callback.
>> matlab.graphics.internal.figfile.FigFile.read
The class matlab.graphics.internal.figfile.FigFile has no Constant property or Static method named 'read'.
>>
How to solve this pblm ?
1 件のコメント
Walter Roberson
2021 年 3 月 28 日
That function requires the Computer Vision Toolbox, R2012a or later
カテゴリ
ヘルプ センター および File Exchange で Spreadsheets についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!