Main Content

clearLegendStrings

Clear alternative legend strings for filters in Filter Analyzer app

Since R2024a

Description

example

clearLegendStrings(fa) clears all the strings that were added to the legends using the setLegendStrings function from the active display of the Filter Analyzer app fa.

clearLegendStrings(fa,Name=Value) specifies additional options using name-value arguments. You can specify the filters whose legend strings you want to clear and the display from which to clear the legend strings

Examples

collapse all

Start Filter Analyzer with two filters and set the names of the filters to "LP1" and "LP2".

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

Append descriptive legend strings to the filters.

setLegendStrings(fa,["FIR 0.45 lowpass" "FIR 0.25 lowpass"])

Clear the appended legend string for the filter with lower passband frequency.

clearLegendStrings(fa,FilterNames="LP2")

Input Arguments

collapse all

Filter Analyzer app handle, specified as a filterAnalyzer object.

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 to clear strings, 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. clearLegendStrings clears only legend strings added using setLegendStrings. The function does not clear filter names.

Example: ["LPbutter" "LPelliptic"]

Data Types: char | string

Version History

Introduced in R2024a