four functions for each radio button written separately.
1.how to call these functions to respective radio buttons.
2.when the push button is pressed, corresponding radio button's function which has been checked should execute.
kindly help me to write a program for this.
thanks
vs
The individual buttons for a uibuttongroup are hidden children of the uipanel
whose handle is returned when the uibuttongroup is created. Hidden in the
sense that their HandleVisibility property is off. allchild() of the handle
returned by the uibuttongroup . The order in the children will be returned in
is the opposite of the order they were added to the group.
Do _not_, however, directly change the Callback property of an individual
button, as uibottongroup will have set the Callback to a function that manages
the group as a whole, deselecting any current selection and selecting the
current one.
Instead, what you should do is set up a SelectionChangeFcn for the
uibuttongroup . Inside the SelectionChangeFcn callback, the evt parameter will
have a field named OldValue which will be the handle of what was previously
selected, and a field named NewValue which will be the handle of what was just
selected.
For a specific programming example, see
http://www.mathworks.com/access/helpdesk/help/techdoc/creating_guis/f10-998412.html#brrll58-1
Walter Roberson <robe...@hushmail.com> wrote in message <hq0247$est$1...@canopus.cc.umanitoba.ca>...
Reference to non-existent field 'ics_si'
ics_si is my function, which has the following code, i do not know where i am making a mistake
i have created the edit box for user to input the values for bore and stroke. and vdisp is calculated and the result is displayed in the third edit box.
function ics_si_Callback(hObject, eventdata, handles)
b = str2double(get(handles.bore,'String'));
s = str2double(get(handles.stroke,'String'));
vdisp = (pi * b * b * s*10^(-3))/4;
set(handles.vdisp,'String',vdisp);
this code must be called when i press the first or second radio button. i.e. when the radio button is pressed, it should call the function ics_si, calculate it and display the result.
how to get this.
Walter Roberson <robe...@hushmail.com> wrote in message <hq0247$est$1...@canopus.cc.umanitoba.ca>...
Hello Viji,
I would like to create a radio button group, and found, on my own, the information in the responses to your questions. But I still do not know how to create, using guide, a radio button group. Could you please enlighten me, or tell me where to find it in the documentation?
Thanks,
-Jeff
function yourSelectionChangeFcn(hObject, eventdata)
handles = guidata(hObject);
switch get(eventdata.NewValue, 'Tag')
case 'tagOfFirstRadioButton'
b = str2double(get(handles.bore,'String'));
s = str2double(get(handles.stroke,'String'));
vdisp = (pi * b * b * s*10^(-3))/4;
set(handles.vdisp,'String',vdisp);
case 'tagOfSecondRadioButton'
b = str2double(get(handles.bore,'String'));
s = str2double(get(handles.stroke,'String'));
vdisp = (pi * b * b * s*10^(-3))/4;
set(handles.vdisp,'String',vdisp);
case 'tagOfSecondRadioButton'
% Do something else.
end
Jeff, there is a simple example at the following address:
http://blinkdagger.com/matlab/matlab-gui-tutorial-buttons-button-group/
Regards.
John,
Thanks for the detail. All I really needed was to learn that there is a tool to create the "button group" on the guide layout screen. I searched the Matlab documentation for "button group" and never came upon this simple fact. If I would have gone back to the basic guide instructions and read through it I would have happened upon it.
I do not like all these icons, I can never remember what the little pictures mean. I am sure I can figure out the details given your example.
-Jeff
There is documentation about creating Gui's in Matlab Help.
http://www.mathworks.com/help/techdoc/creating_guis/bqz6p81.html
But if you want to create a special object, you need to use Google for searching. You can also have a look following video, which shows how to create a simple Gui using Guide.
http://www.mathworks.com/videos/matlab/creating-a-gui-with-guide.html
"Little pictures" are your objects in your Gui and each of them has special properties. So you get used to them after creating a few Gui's. No worries!
Regards.