I'm getting a Error using get, Unrecognized property String for class Root. in my program, all I what is to hit the push button and have no problem.
Show older comments
Error while evaluating UIControl Callback.
>> BSA
Error using get
Unrecognized property String for class Root.
Error in BSA>height_Callback (line 113)
handles.height= str2double(get(handles.height, 'String'));
--------------------------------------------------------------------------
function kilograms_Callback(hObject, eventdata, handles)
% hObject handle to kilograms (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of kilograms as text
% str2double(get(hObject,'String')) returns contents of kilograms as a double
handles.kilograms= str2double(get(handles.kilograms, 'String'));
guidata(hObject,handles)
-----------------------------------------------------------------------------------
function height_Callback(hObject, eventdata, handles)
% hObject handle to height (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of height as text
% str2double(get(hObject,'String')) returns contents of height as a double
handles.height= str2double(get(handles.height, 'String')); %line 115
guidata(hObject,handles)
-------------------------------------------------------------------------------------------------
function Enterbotton_Callback(hObject, eventdata, handles)
% hObject handle to Enterbotton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles.kilograms= str2double(get(handles.kilograms,'string'));
handles.height= str2double(get(handles.height,'string'));
handles.BSA= 0.007184*(handles.kilograms)^0.425*(handles.height)^0.75;
set(handles.pantalla,'string',handles.BSA);
guidata(hObject,handles)
Accepted Answer
More Answers (0)
Categories
Find more on Text Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!