function figName = setFileName(matFileName,figExt)

   fname = matFileName;
   idx1 = strfind(fname,'_');
   idx2 = strfind(fname,'.');
   idx2 = idx2-1;
   if(isempty(idx1))
    idx1 = 1;
   else
    idx1 = idx1+1;   
   end
   fname = fname(idx1:idx2);
   figName = ['fig_',fname,figExt];