matlab: using importdata() to automatically change headerlines from file to file
===

Okay so I have multiple files that I'm trying to import for analysis, and I'm using uiimport() to do this within a script currently, but I have to manually shift the headerlines for each file as they change every time.  I would like to do something like this:

    DELIMITER = ',';

    HEADERLINES = 50; 
 
    data_imported = importdata(file_to_get, DELIMITER, HEADERLINES);

But the issue is that only 1 or 2 of my 300~ files has a headerline count of 50.  Another very important note, is that the default number of headerlines for EVERY file only needs to have 2 added to it.  So if the default headerline number while using uiimport() is 50, then i would need to change it to 52.

Would there be a way to change this with possibly an if statement? Note: defaultheader is being used as and example and not an actual variable.

for example:

    If defaultheader = 30

         header = 32
    end

thanks