Main Content

slrealtime.instrument.LineStyle

Create real-time instrument LineStyle object

Since R2022b

Description

An slrealtime.instrument.LineStyle object defines line style properties for a connectLine function.

Creation

lineStyle_object = slrealtime.instrument.LineStyle() creates an empty instrument LineStyle object for setting line style properties.

Example: Configure Line Style Properties for connectLine

Properties

expand all

Select the line color.

Example: myLineStyle.Color = 'black';

Select the marker character in the line.

Example: myLineStyle.Marker = '*';

Select the marker character size in the line.

Example: myLineStyle.MarkerSize = 4;

Select the line style character.

Example: myLineStyle.Style = '--';

Select the line width.

Example: myLineStyle.Width = 1;

Select a line label.

Example: myLineStyle.Label = 'My Line';

Examples

collapse all

  • You can configure style properties in a LineStyle object and apply the style in the connectLine function.

    tg = slrealtime;
    removeAllInstruments(tg);
    % next assumes that real-time application has been built
    mldatxfile = 'slrt_ex_pendulum_100Hz.mldatx';
    hInst  = slrealtime.Instrument(mldatxfile);
    myLineStyle = slrealtime.instrument.LineStyle();
    myLineStyle.Marker = '*';
    myLineStyle.MarkerSize = 4;
    myLineStyle.Color = 'black';
    myLineStyle.Label = 'Cart Position';
    hAxis = uiaxes ();
    legend(hAxis);
    connectLine(hInst,hAxis,'cartposition', ...
        'LineStyle', myLineStyle);
    addInstrument(tg,hInst);
    load(tg,mldatxfile);
    start(tg);
    pause(10);
    stop(tg);

Version History

Introduced in R2022b

expand all