No BSD License  

Highlights from
CoCoMac

image thumbnail
from CoCoMac by James Allen
Download CoCoMac.org cortical connectivity data, model it as a network, and simulate epileptic sprea

fc_add_to_listbox(listBox)
function [] = fc_add_to_listbox(listBox)

% Function to *add* the selected strings in list box of all nodes, designated by handle
% 'listBox', to the list box designated by handle 'listBox'

select_values = get(findobj('tag', 'list_startNodes'), 'Value');
nodes = get(findobj('tag', 'list_startNodes'), 'string');
no_of_selected = length(select_values);

% Get cell array of already selected nodes
selected_nodes = get(listBox, 'String');

for addCounter = 1 : no_of_selected
    selected_nodes{end+1} =  nodes{select_values(addCounter)};
end

% We may have added nodes that were already there - remove these
% duplicates. The unique function also returns an alphabetically sorted
% list.
selected_nodes = unique(selected_nodes);

% Set the new string value in the list box
set(listBox, 'String', selected_nodes);

% Make animation panel invisible - because you need to run simulation first
% to update the activ matrix before you can run an animation
set(findobj('tag', 'panel_animation'), 'visible', 'off');
set(findobj('tag', 'animation_frame_label'), 'visible', 'off');
set(findobj('tag', 'animation_frame_editbox'), 'visible', 'off');
set(findobj('tag', 'animation_slider'), 'visible', 'off');

return;

Contact us at files@mathworks.com