making compatible back to R2009b