GUI giving errors after upgrading Matlab to R2014b

1 view (last 30 days)
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?

Accepted Answer

Samuel Lazerson
Samuel Lazerson on 20 Feb 2015
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.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!