Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % --- Executes on button press in findRootsBtn.
- function findRootsBtn_Callback(hObject, eventdata, handles)
- rootsStr = get(handles.eqnInput, 'String');
- coeffsStr = strsplit(rootsStr, ' ');
- coeffs = str2double(coeffsStr);
- if any(isnan(coeffs))
- set(handles.text16, 'String', 'Error: Please enter valid numeric coefficients.');
- return;
- end
- rootsResult = roots(coeffs);
- rootsFormatted = sprintf('%.4f\n', rootsResult);
- set(handles.text16, 'String', rootsFormatted);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement