The edit field must have a mathematical equation alert using MATLAB GUIDE
Mostra commenti meno recenti
I want to add a validation to the first edit field shown in the following interface:

So, if the user enters something rather than a mathematical equation, an error message must appear to the user.
How can I do such a validation, what shall I be writing exactly in the edit field call back function to do that?
function editEquation_Callback(hObject, eventdata, handles)
% hObject handle to editEquation (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 editEquation as text
% str2double(get(hObject,'String')) returns contents of editEquation as a double
if ()
errordlg('Enter a valid mathematical equation', 'Error', 'modal');
else
%do nothing
end
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su App Building in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!