MATLAB: GUI Self-Replicating Problem when Radio Button Clicked

guiMATLABradio buttonscript

I am working on a project which requires the user be able to switch between graphs. For ease of use, I am attempting to use Radio Buttons to switch between graphs. In the callbacks for the selection of the radio buttons, I refer to outside scripts rather than placing the entire code within the radio buttons as a means of keeping things simpler. However, instead of running the scripts when a radio button is selected, another window identical to the original GUI opens. I can't figure out why this is and would like very much for the embedded axes to be updated with the desired graph rather than another GUI window open… Any suggestions?

Best Answer

Hard to say without looking at the callback, but it appears that the gui is calling itself. That's about all we can say without seeing the code. Attach the m and fig files if you want more advice.