butter, as the name indicates, is used to construct the Butterworth IIR filter.
designfilt can be used to design the Butterworth filter as well, but you can design the other type filters with this function.
What type filter you need depends on your application. For example, the Butterworth filter rolls off more slowly around the cutoff frequency than the Chebyshev filter or the Elliptic filter, and it may decide your selection.
From the point of view of a coder, the use of
designfilt can be preferable even when constructing the Butterworld filter. The function uses a name-value syntax and enables one to create a
d = designfilt(resp,Name,Value)
d is the
digitalFilter object. The
digitalFilter object bundles all the parameters of a linear filter into a single container. The object
digitalFilter is immutable, and after it is created, you can edit it only with the Filter Design Assistant that you open with the command
On the other hand, the syntax of
butter is simpler, the filter type stands out, and the function explicitly returns the matrix of coefficients.
But the most prominent feature of
butter is that, using the syntax
[___] = butter(___,'s')
with the option 's' indicated (contrast it with default 'z' used for the digital filter design),
butter returns the matrix of coefficients for the analog filter design -- which, by definition, the digitalFilter object cannot readily provide.