modifyCursor
Modify properties of Logic Analyzer cursor
Description
Examples
Modify Logic Analyzer Cursors Programmatically
This example shows how to use functions to create, manipulate, and delete cursors in a dsp.LogicAnalyzer
object.
Create Logic Analyzer and Signals
scope = dsp.LogicAnalyzer('NumInputPorts',3); for ii = 1:20 scope(ii,10*ii,20*ii); end
Add Cursor
Add a cursor at 15 seconds and show the cursor information.
cursor = addCursor(scope,'Location',15,'Color','Cyan'); getCursorInfo(scope,cursor)
ans = struct with fields:
Location: 15
Color: [0 1 1]
Locked: 0
Tag: 'C2'
Modify Cursor
Change the cursor color to magenta.
hide(scope) modifyCursor(scope,cursor,'Color','Magenta') show(scope)
Remove Cursor
Delete the yellow cursor at 0
seconds.
hide(scope) tags = getCursorTags(scope); deleteCursor(scope,tags{1}); show(scope)
Input Arguments
scope
— The Logic Analyzer object for which you want to modify a cursor
dsp.LogicAnalyzer
object
The Logic Analyzer object for which you want to modify a cursor specified, as a handle to the dsp.LogicAnalyzer
object.
tag
— The tag identifying which cursor to modify
character vector | string scalar
The tag identifying which cursor to modify specified.
Example: modifyCursor(scope,'C4')
modifies a cursor in Logic Analyzer.
Example: modifyCursor(scope,"C4")
modifies a cursor in Logic Analyzer.
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.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'Location',2,'Color','Blue'
specifies
that a cursor should be moved to the 2-second mark and colored blue.
Color
— Color of the cursor
'Yellow'
(default) | character vector | three element numeric vector | string scalar
Color of the cursor, specified as a [R G B]
number value, color name, or
color short name:
Color Name | Short Name | RGB Triplet | Appearance |
---|---|---|---|
"red" | "r" | [1 0 0] |
|
"green" | "g" | [0 1 0] |
|
"blue" | "b" | [0 0 1] |
|
"cyan"
| "c" | [0 1 1] |
|
"magenta" | "m" | [1 0 1] |
|
"yellow" | "y" | [1 1 0] |
|
"black" | "k" | [0 0 0] |
|
"white" | "w" | [1 1 1] |
|
Example: 'Color','blue'
Example: 'Color',[0,0,1]
Data Types: char
| string
| double
| single
| uint8
| uint16
| uint32
| uint64
| int8
| int16
| int32
| int64
Location
— Location of the cursor
0
(default) | numeric scalar
Specify as a numeric scalar value, in seconds, the cursor location.
Example: 'Location',1
Data Types: double
Locked
— Locked status of the cursor
false
(default) | true
Locked status of the cursor, specified as false
or true
.
true
— the cursor location cannot be changed. Logic Analyzer denotes the locked cursor by assigning a default color of gray. This color cannot be changed.false
— the cursor location can be changed. Logic Analyzer denotes the unlocked cursor by assigning a default color of yellow.
Example: 'Locked',true
Version History
Introduced in R2013a
See Also
dsp.LogicAnalyzer
| addCursor
| deleteCursor
| getCursorTags
| getCursorInfo
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)