Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

GUI closing automatically?

Asked by Niranjan on 22 Feb 2011

Hi I've got a problem again. I've got a face detection algorithm. When I try to implement in GUI. After selecting the first button, the corresponding operation takes place but this closes the GUI! Where should the problem probably be? Any guesses? And how can I avoid this??

0 Comments

Niranjan

2 Answers

Answer by Jiro Doke on 22 Feb 2011
Accepted answer

I would assume you have a close, closereq, or delete somewhere in your code. Put a breakpoint on the first line of your button callback, and step through one line at a time, and you should be able to discover the problem

6 Comments

Niranjan on 25 Feb 2011

I am sorry guys , Jiro was rite . It is my habit to use clc;clear all;close all; at the starting of the code. That's what caused me the problem. When I removed it ,things were back to normal.

Jan Simon on 25 Feb 2011

Another strong hint that "clc;clear all; close all" is not useful but more likely causes trouble.

Arun Badigannavar on 4 Apr 2013

Very helpful

Jiro Doke

Contact us