https://github.com/PerezOrtegaJ/Neural_Ensemble_Analysis
Tip revision: 9d37fd031dfbdb4eb69faa449d0a6416267a7d4f authored by Jesús Pérez on 28 July 2020, 20:36:58 UTC
Update README.md
Update README.md
Tip revision: 9d37fd0
Get_Circular_XY.m
function [xy,step] = Get_Circular_XY(n,radio,offset)
% Get circular coordinates for n elements given a radio and offset in
% degrees
%
% [xy,step] = Get_Circular_XY(n,radio,offset)
%
% Perez-Ortega Jesus - April 2018
% modified April 2019
switch(nargin)
case 1
radio = 1;
offset = 0;
case 2
offset = 0;
end
% convert to radians
offset = offset*pi/180;
if (n==1)
xy=[0 0];
step = 0;
else
xy=[cos(offset+2*pi*(1:n)'/n) sin(offset+2*pi*(1:n)'/n)].*radio;
step = 360/n;
end