How to pass a square wave through transfer function in MATLAB?
There are a number of ways to do this and each have their merits


Simulink.
The most visually intuitive method to perform what you are requesting
Matlab script using ft, gensig &amp; lsim

H = tf(1,[1e-3 1]);
[sig,t] =  = gensig('square',10e-3,50e-3,1e-6);
lsim(H,sig,t);