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_saveActiv(activ, activLabels, net, netLabels, data, startNodes, removeNodes)
function [] = fc_saveActiv(activ, activLabels, net, netLabels, data, startNodes, removeNodes)

% Saves simulation data as matlab varaibles in a .mat file. Variables
% saved:
% activ, activLabels: spreading activation matrix and labels
% net, netLabels: connectivity matrix
% data: full data structure
% startNodes, removeNodes: any nodes selected for starting activation or
% for removal

if isempty(activ) | isempty(net) | isempty(activLabels) | isempty(netLabels) | isempty(data) | isempty(startNodes)
    errordlg('Cannot save - need to have loaded some network data, selected 1 or more start nodes, and run a simulation.')
    return;
end

% Ask the user where to save mat file
[save_name, save_path] = uiputfile('.mat', 'Save activation-spreading data');
saveFile = [save_path save_name];

% If the user did not select a file..
if isequal(save_path,0) | isequal(save_name,0)
    msgbox('Did not save data!', 'Warning,', 'warn')
    % Otherwise...
else
    try
        save (saveFile, 'activ', 'activLabels', 'net', 'netLabels', 'data', 'startNodes', 'removeNodes');
        fc_saveLog(['Saved simulation data to: ' saveFile]);
    catch
        errordlg(['Error saving data structure to ' saveFile ': ' lasterr])
    end
end



return

Contact us at files@mathworks.com