
% remove values corresponding to index q

% first identify all variables with length=length(t)
vars=whos;

lengtht=length(id);
for truncateind=1:size(vars,1);
  if (vars(truncateind).size(1)==lengtht & ...  % length=length(t)
          vars(truncateind).size(2)==1 & ...    % Not a matrix
          (vars(truncateind).name~='q' | ...    % not vector q,
          length(vars(truncateind).name)>1)   )  
      % final line needed for variables starting with q, like "qual".
    eval([vars(truncateind).name,'(q)=[];']);
  end;
end;

clear vars lengtht truncateind q ans;

