www.gusucode.com > mbctools 工具箱 matlab 源码程序 > mbctools/@sweepsetfilter/modifySweepNote.m

    function obj = modifySweepNote(obj, index, noteExp, noteString, noteColor)
%MODIFYSWEEPNOTE Alter a sweep note
%
%  SSF = MODIFYSWEEPNOTE(SSF, INDEX, EXPR, NOTESTR, COLOR) modifies a sweep
%  note definition.

%  Copyright 2000-2005 The MathWorks, Inc. and Ford Global Technologies, Inc.


% Ensure that noteExp is a cell array
if ~iscell(noteExp)
	noteExp = {noteExp};
end

% Have we sent in any notes
if nargin < 4
    [noteString{1:length(index)}] = deal(obj.sweepNotes(index).noteString);
elseif ~iscell(noteString)
    noteString = {noteString};
end

% Have we sent in any colors
if nargin < 5
    [noteColor{1:length(index)}] = deal(obj.sweepNotes(index).noteColor);
elseif ~iscell(noteColor)
    noteColor = {noteColor};
end

% Iterate through the notes to change
for i = 1:length(index)
    thisNoteColor = noteColor{i};
    if ~isnumeric(thisNoteColor) || ~isequal(size(thisNoteColor), [1 3])
        thisNoteColor = [1 0 0];
    end
    obj.sweepNotes(index(i)) = parseNoteString(noteExp{i}, noteString{i}, thisNoteColor);
end

% Update the sweep note cache
obj = updateSweepNotes(obj, [], index);