How can I detect if a filter is FIR or IIR according to impulse response graph? I have the following two graphs but I don't know how to recognize from the graph if they are IIR or FIR! Can you please guide me through? 


P.S.: Does MATLAB have a function to detect if an impulse response graph corresponds to IIR or FIR?
If a filter is FIR then the impulse response is finite and goes to zero and stays there. This is like the second filter in your post. If it is IIR the impule response extends towards infinity like the first image in your post