Error: Line 80: SWITCH expression must be a scalar or a character vector

The issue is that the fir1.m function that is being called is the one in FiledTrip, i.e., it is shadowing the one from Matlab.

Check this post: