I´ve been struggeling with the same problem.
Here is a solution to the problem.
var_names = {'sea_p' 'sfc_p' 'sfc_geop' 'geop_h' 'o3_mix' 'sp_hum' 'cld_l_mix' 'cld_i_mix' 'rel_hum' 'temp' 'u' 'v' 'pot_vort' 'omega' 'long' 'lat' 'height' 'time'); %made it into a row instead.
for a = 1:17...