Main Content

addCursor

Add cursor to Logic Analyzer

Description

cursorTag = addCursor(scope) adds in a cursor to the display. A tag value is returned, which can be used to modify and delete the cursor.

cursorTag = addCursor(scope,Name,Value) sets properties using one or more name-value pairs. Enclose each property name in single quotes.

example

Examples

collapse all

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

collapse all

Example: addCursor(scope) adds a cursor with the default characteristics.

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 of the cursor, specified as a [R G B] number value, color name, or color short name:

Color NameShort NameRGB TripletAppearance
"red""r"[1 0 0]

Sample of the color red

"green""g"[0 1 0]

Sample of the color green

"blue""b"[0 0 1]

Sample of the color blue

"cyan" "c"[0 1 1]

Sample of the color cyan

"magenta""m"[1 0 1]

Sample of the color magenta

"yellow""y"[1 1 0]

Sample of the color yellow

"black""k"[0 0 0]

Sample of the color black

"white""w"[1 1 1]

Sample of the color white

Example: 'Color','blue'

Example: 'Color',[0,0,1]

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

Specify as a numeric scalar value, in seconds, the cursor location.

Example: 'Location',1

Data Types: double

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