Main Content

setLegendStrings

Define alternative legend strings for filters in Filter Analyzer app

Since R2024a

Description

example

setLegendStrings(fa,strs) appends strings to the default legend strings for all the filters plotted in the active display in the Filter Analyzer app fa.

setLegendStrings(fa,strs,Name=Value) specifies additional options using name-value arguments. You can specify the filters whose legend strings you want to modify and the display in which to show the modified legend strings.

Examples

collapse all

Design two lowpass filters. Start a Filter Analyzer session and display the filters.

d1 = designfilt("lowpassfir", ...
    PassbandFrequency=0.45,StopbandFrequency=0.55);
d2 = designfilt("lowpassfir", ...
    PassbandFrequency=0.25,StopbandFrequency=0.35);
fa = filterAnalyzer(d1,d2);

Update the legend strings of the filters, calling them "LowpassFilter1" and "LowpassFilter2".

setLegendStrings(fa,["LowpassFilter1" "LowpassFilter2"])

Input Arguments

collapse all

Filter Analyzer app handle, specified as a filterAnalyzer object.

Legend strings, specified as a string vector. The vector must have a number of elements equal to the number of filters plotted in the display of interest or to the number of names specified in FilterNames. By default, legend strings are set to the filter names.

Example: ["0.45 passband" "0.25 passband"]

Data Types: char | string

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 modify legends, specified as a vector of display numbers. If you do not specify this argument, Filter Analyzer modifies the legends in the active display.

Example: [1 4]

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

Filter names, specified as a string vector. setLegendStrings updates only the filters whose names are specified in FilterNames. Filter names are the names that identify the different filters in the app Filters table.

Example: ["LPbutter" "LPelliptic"]

Data Types: char | string

Version History

Introduced in R2024a