Main Content

modifyCursor

Modify properties of Logic Analyzer cursor

Description

example

modifyCursor(scope,tag) modifies the properties of the Logic Analyzer cursor specified by the input tag.

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

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

The Logic Analyzer object for which you want to modify a cursor specified, as a handle to the dsp.LogicAnalyzer object.

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 comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

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

Introduced in R2013a