Here you cannot give a value that is greater than 1 for the first argument of the fir1 function. It should be between 0 and 1. Let it be said that the cutoff frequency is Fc, and the sampling frequency is Fs, then if we take Wn as the first argument, which is the cutoff frequency as a normalized value. Here's how to calculate Wn.
Wn = (2/Fs)*Fc
Then you can apply the filter function as shown below:
filt = fir1(Wn , 0.2); filter(filt, 1, mysignal);
source share