Matlab controller