ensure backwards compatibility up to R2023b