MATLAB: How to link two radiobutton groups

matlab gui

Best Answer

Don't use the tag property for the ages. Use the Value property to get the index. The check for cases 1, 2, 3, 4, etc. (integers, not strings).
Also you mgiht have to convert calorie to a string to put it into the String property:
set(handles.text2, 'String', num2str(calorie));
Related Question