movealgorithm.m
来自「最新的模式识别分类工具箱,希望对朋友们有用!」· M 代码 · 共 48 行
M
48 行
function MoveAlgorithm(direction)
%This function locates the algorithm chosen on the multialgorithm screen and
%moves it to the chosen algorithms screen.
if direction,
hFrom = findobj('Tag','lstAllAlgorithms');
hTo = findobj('Tag','lstChosenAlgorithms');
else
hTo = findobj('Tag','lstAllAlgorithms');
hFrom = findobj('Tag','lstChosenAlgorithms');
end
%Find the selected algorithm and remove it from the 'From list'
val = get(hFrom,'Value');
algorithms = get(hFrom,'String');
algorithm = algorithms(val,:);
if (isempty(deblank(algorithm)))
break
end
newlist = 1:size(algorithms,1);
newlist(val) = 0;
newlist = newlist(find(newlist ~=0));
set(hFrom, 'Value', 1);
if ~isempty(newlist),
set(hFrom, 'String', algorithms(newlist,:));
else
set(hFrom, 'String', ' ');
end
%Put the new algorithm in the 'To list'
algorithms = get(hTo,'String');
L = max(size(algorithms,2),size(algorithm,2));
if ((isempty(deblank(algorithms(1,:)))) & (size(algorithms,1) == 1))
newalgorithms = algorithm;
else
newalgorithms = zeros(size(algorithms,1)+1,L);
newalgorithms(1:size(algorithms,1),:) = algorithms;
newalgorithms(size(algorithms,1)+1,:) = algorithm;
end
set(hTo, 'String', char(newalgorithms))
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?