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!