https://github.com/PerezOrtegaJ/Neural_Ensemble_Analysis
Raw File
Tip revision: 9d37fd031dfbdb4eb69faa449d0a6416267a7d4f authored by Jesús Pérez on 28 July 2020, 20:36:58 UTC
Update README.md
Tip revision: 9d37fd0
Get_Force_XY.m
function xy = Get_Force_XY(adjacency)
% Get coordinates to plot network in 2D with force layout
%
%       xy = Get_Force_XY(adjacency)
%
% Jesús Pérez-Ortega nov 2018

if isempty(adjacency)
    xy = [];
    return
end

% Get coordinates 
G=graph(adjacency);
figure();
%G_plot=plot(G,'Layout','force','usegravity',true);
%G_plot=plot(G,'Layout','force','weighteffect','direct');
%G_plot=plot(G,'Layout','force','usegravity',true,'iterations',250);
G_plot=plot(G,'Layout','force','iterations',250);
xy = [G_plot.XData' G_plot.YData'];
close;
back to top