MATLAB: Delete variables without deleting gui

gui

i design a GUI…. and inside a button i give "clear all" to clear all variables as it takes lots of space… but the gui design tables and static text and axes and all the other design items also gets cleared…. how to clear only variables without clearing the gui design….

Best Answer

Elysi - if there are specific variables that you want cleared, then you can clear them by name:
x = zeros(100,100);
y = zeros(1000,33);
z = ones(32,32);
% do some stuff
% clear just x and y only
clear x y;
Type help clear from at the command window for more details.