You can do this with Matlab Block in system Generator as well. But there are some restrictions for math operations - multiplying only by power of 2 and no division and for loops. In my opinion SG generates good code for matlab only if you need to have a lot of switch-case statements. If you have a lot of calculations then you have to control precision in matlab with special functions. Otherwise matlab maintains full precision and generates huge adders and substractors (like Fix50_20). In this case it is easier to control with standard SG blocks.