File Exchange Pick of the Week

Our best user submissions

Cursorbar

Sean‘s pick this week is Cursorbar by Marjorie.

I really like both Simulink Data Inspector and the new Signal Analyzer App for comparing and analyzing signal data. They make it easy to rapidly compare lots of signals, and with the Signal Analyzer to see the spectrum and spectrogram in the same window as the signal. Additionally, they also have data cursors that allow me to scan the values of multiple signals at the same time. Here’s a screen shot of all of the features I just mentioned:

So what if you want a data cursor on a regular MATLAB plot? Well now you can with Marjorie’s cursorbar. Cursorbar gives you plenty of control over its appearance and behavior to meet all of your data cursor needs.

Look at the help for a whole slew of examples! Here’s the 9th one:

% Create line plot
x = linspace(0,14,201);
y = sin(2*pi*x/3);
h = plot(x,y,':k','LineWidth',2);
ylim([-1.2 1.2])

% Define colors
topMarkers = 'x+*o.sdv^><ph'; % top marker styles
bottomMarkers = 'x+*o.sd^v<>hp'; % bottom marker styles
targetMarkers = '+xo*.dsddddhp'; % target marker styles
lineColor = lines(13); % cursorbar colors

% Create cursorbars
for ii=13:-1:1
    c(ii) = graphics.Cursorbar(h,'Location',ii);
    %
    c(ii).TopMarker = topMarkers(ii);
    c(ii).BottomMarker = bottomMarkers(ii);
    c(ii).TargetMarkerStyle = targetMarkers(ii);
    %
    c(ii).CursorLineColor = lineColor(ii,:);
    c(ii).TargetMarkerEdgeColor = 1-lineColor(ii,:);
    %
    c(ii).TopHandle.MarkerSize = 12;
    c(ii).BottomHandle.MarkerSize = 12;
end
%
set(c,'ShowText','off','TargetMarkerSize',12,'TargetMarkerFaceColor','w')

Comments

Give it a try and let us know what you think here or leave a comment for Marjorie.

Published with MATLAB® R2017a

|
  • print
  • send email

评论

要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。