Main Content

showFilters

Show or hide filters in Filter Analyzer app

Since R2024a

Description

showFilters(fa,showit) shows or hides all filters on the active display of the Filter Analyzer app fa depending on whether showit is true or false, respectively. If showit is true and there is no display, the app adds one and plots the filters on it. If you want to show only a subset of the filters, use FilterNames to specify which ones.

example

showFilters(___,Name=Value) specifies options using name-value arguments in addition to the input arguments from the previous syntax. You can choose the filters to show or hide and the display in which you want to show them or hide them.

example

dispnum = showFilters(___) returns the identification number of the new display, if showFilters adds one.

Examples

collapse all

Design two lowpass filters and display their magnitude responses in Filter Analyzer.

d1 = designfilt("lowpassiir", ...
    PassbandFrequency=0.45,StopbandFrequency=0.55);
d2 = designfilt("lowpassiir", ...
    PassbandFrequency=0.25,StopbandFrequency=0.35);
fa = filterAnalyzer(d1,d2,FilterNames=["LP1" "LP2"]);

Add a display to analyze phase response. Set the number of NFFT points to 1024. Show the filters.

phaseDispNum = addDisplays(fa,Analysis="phase",NFFT=1024);
showFilters(fa,true, ...
    FilterNames=["LP1" "LP2"],DisplayNums=phaseDispNum)

Remove the filter plots from the phase response display.

showFilters(fa,false,DisplayNums=phaseDispNum)

Input Arguments

collapse all

Filter Analyzer app handle, specified as a filterAnalyzer object.

Show option, specified as a logical 0 (false) or 1 (true).

Data Types: logical

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: FilterNames=["LP" "HP"],SampleRates=[150 3e3]

Displays on which to plot filters, specified as a vector of display numbers. If you do not specify this argument, Filter Analyzer uses the active display. Use display identification numbers to target displays when using other Filter Analyzer functions. Identification numbers appear above the plotting area of the app, on the tabs that correspond to the different displays.

Example: [1 4]

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Filter names, specified as a string vector. Filter names are the names that identify the different filters in the app Filters table. Use this argument to specify which filters you want to appear in the selected displays.

Example: ["LPbutter" "LPelliptic"]

Data Types: char | string

Output Arguments

collapse all

Display identification number, returned as an integer or vector of integers. If showFilters adds more than one display, dispnum is a vector. Use display identification numbers to target displays when using other Filter Analyzer functions. Identification numbers appear above the plotting area of the app, on the tabs that correspond to the different displays.

Version History

Introduced in R2024a