Check for time invariance of a _system_ using MATLAB?
You can't do that. What you can do is write a function that computes the output given the input signal, then shifts the input signal (the shift could be an input parameter), and then checks if the output signal is a shifted version of the original output signal. If this is NOT the case, then you know that the system is time varying. However, if the output signal is just a shifted version of the original output signal then you don't know anything, because you would need to try all possible (i.e. infinitely many) shifts (and all possible input signals) and verify this condition for all these cases. Only after having checked infinitely many shifts (and all possible input signals) would you be able to assert that the system is indeed time-invariant.