www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/ClearVariablesUsingRegularExpressionsandNameVariablestoEExample.m

    %% Clear Variables Using Regular Expressions and Name Variables to Exclude  
% Clear variables with names that start with |b| and are followed by 3 digits,
% except for the variable |b106|.   

% Copyright 2015 The MathWorks, Inc.


%%  
clearvars -regexp ^b\d{3}$ -except b106