GUI giving errors after upgrading Matlab to R2014b

조회 수: 1 (최근 30일)
Samuel Lazerson
Samuel Lazerson 2015년 2월 19일
답변: Samuel Lazerson 2015년 2월 20일
Recently upgraded to R2014b. I've been getting a brand new warning type error from Matlab from a GUI which was working before the upgrade. When I select a radio button from a radio button group I get:
Undefined function handle.
Error while evaluating UIControl Callback
Now this is doesn't prevent the code from working but is really annoying. The it only happens when I change buttons so I think it's probably associated with this piece of code.
function cutplane_SelectionChangeFcn(hObject, eventdata, handles)
% hObject handle to the selected object in cutplane
% eventdata structure with the following fields (see UIBUTTONGROUP)
% EventName: string 'SelectionChanged' (read only)
% OldValue: handle of the previously selected object or empty if none was selected
% NewValue: handle of the currently selected object
% handles structure with handles and user data (see GUIDATA)
switch get(eventdata.NewValue,'Tag')
case 'rcut'
handles.cuttype='r1d';
case 'thetacut'
handles.cuttype='theta1d';
case 'zetacut'
handles.cuttype='zeta1d';
case 'fluxcut'
handles.cuttype='r2';
case 'polcut'
handles.cuttype='theta2';
case 'rzcut'
handles.cuttype='zeta2';
case 'threedcut'
handles.cuttype='3D';
end
guidata(hObject,handles);
guiupdate(hObject,handles);
Now I see that this should probably be SelectionChangedFcn rather than SelectonChangeFcn but when I make this change then basically the propery of the fig isn't correct for the GUI.
Any thoughts?

채택된 답변

Samuel Lazerson
Samuel Lazerson 2015년 2월 20일
Found the solution. Apparently I never had any callbacks for the radio buttons associated with the ButtonGroup. So by simply adding the default Callback for each button the error went away. I did this in GUIDE by selecting each radio button and right clicking on each one then selecting the Callback submenu.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by