Convolution is used when your system has the following two properties
1 Linear Time Invariant: The output of the system does not change if you apply same input at another time. If your input is combination of inputs like x1 + x2 then the output should also be the sum of two individual outputs y1 + y2.
2 Finite Impulse Response: If you apply an impulse of short duration to the system then you should have finite output which decay over time.
If your system has the above properties then you can get the output by doing convolution of input signal and system impulse response. Matlab provide the function for convolution