fig=createmadfig('wangNetwork'); 
	
presets = uimenu('Parent',fig, ...
	'Label','Presets', ...
	'Tag','presetMenu');
	
uimenu('Parent',presets, 'Callback','wangNetwork segregated', ...
	'Label','All segregated', 'Tag','segregated');
uimenu('Parent',presets, 'Callback','wangNetwork grouped', ...
	'Label','All grouped', 'Tag','grouped');
uimenu('Parent',presets, 'Callback','wangNetwork twogroup', ...
	'Label','Two groups of two','Tag','twotwo');
uimenu('Parent',presets, 'Callback','wangNetwork rbgroup', ...
	'Label','Red and blue grouped', 'Tag','rbgroup');

fig=createmadmenus(fig);

b = uicontrol('Parent',fig, ...
	'FontSize',14, ...
	'Position',[0.1543    0.9190    0.2773    0.0481], ...
	'String','Phase Plane', ...
	'Style','text', ...
	'Tag','StaticText1');
	
b = uicontrol('Parent',fig, ...
	'FontSize',14, ...
	'Position',[0.6270    0.9190    0.2891    0.0456], ...
	'String','Time domain', ...
	'Style','text', ...
	'Tag','StaticText2');
	
b = uicontrol('Parent',fig, ...
	'Callback','wangNetwork doPlot', ...
	'Position',[0.2598    0.0253    0.2402    0.0911], ...
	'String','Begin simulation', ...
	'Tag','beginButton');
	
b = uicontrol('Parent',fig, ...
	'Callback','wangNetwork zsliderChanged', ...
	'Position',[0.0977    0.2430    0.2930    0.0481], ...
	'String','WZ', ...
	'Style','slider', ...
	'Tag','zslider', ...
	'Value',0.4);
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Callback','WangDemoTwo zboxChanged', ...
	'Position',[0.4043    0.2430    0.0938    0.0506], ...
	'String','0.4', ...
	'Style','edit', ...
	'Tag','zbox');
	
b = uicontrol('Parent',fig, ...
	'Position',[0.0254    0.2481    0.0508    0.0405], ...
	'String','WZ', ...
	'Style','text', ...
	'Tag','StaticText3');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[0 0 1], ...
	'ForegroundColor',[0 0 1], ...
	'Position',[0.7070    0.2582    0.0391    0.0506], ...
	'Tag','Pushbutton2');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 0 0], ...
	'Position',[0.7461    0.2582    0.0391    0.0506], ...
	'Tag','Pushbutton3');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[0 1 1], ...
	'Position',[0.8242    0.2582    0.0391    0.0506], ...
	'Tag','Pushbutton4');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[0 1 0], ...
	'Position',[0.7852    0.2582    0.0391    0.0506], ...
	'Tag','Pushbutton5');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[0 0 1], ...
	'Position',[0.6680    0.2076    0.0391    0.0506], ...
	'Tag','Pushbutton6');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[0 1 0], ...
	'Position',[0.6680    0.1063    0.0391    0.0506], ...
	'Tag','Pushbutton7');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 0 0], ...
	'Position',[0.6680    0.1570    0.0391    0.0506], ...
	'Tag','Pushbutton8');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[0 1 1], ...
	'Position',[0.6680    0.0557    0.0391    0.0506], ...
	'Tag','Pushbutton9');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Callback','wangNetwork box12', ...
	'Position',[0.7461    0.2076    0.0391    0.0506], ...
	'Tag','box12');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Position',[0.7070    0.2076    0.0391    0.0506], ...
	'Tag','box11');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Callback','wangNetwork box14', ...
	'Position',[0.8242    0.2076    0.0391    0.0506], ...
	'Tag','box14');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Callback','wangNetwork box13', ...
	'Position',[0.7852    0.2076    0.0391    0.0506], ...
	'Tag','box13');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Position',[0.7461    0.1570    0.0391    0.0506], ...
	'Tag','box22');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Callback','wangNetwork box24', ...
	'Position',[0.8242    0.1570    0.0391    0.0506], ...
	'Tag','box24');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Callback','wangNetwork box23', ...
	'Position',[0.7852    0.1570    0.0391    0.0506], ...
	'Tag','box23');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Callback','wangNetwork box21', ...
	'Position',[0.7070    0.1570    0.0391    0.0506], ...
	'Tag','box21');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Callback','wangNetwork box32', ...
	'Position',[0.7461    0.1063    0.0391    0.0506], ...
	'Tag','box32');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Position',[0.7852    0.1063    0.0391    0.0506], ...
	'Tag','box33');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Callback','wangNetwork box34', ...
	'Position',[0.8242    0.1063    0.0391    0.0506], ...
	'Tag','box34');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Callback','wangNetwork box41', ...
	'Position',[0.7070    0.0557    0.0391    0.0506], ...
	'Tag','box41');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Callback','wangNetwork box43', ...
	'Position',[0.7852    0.0557    0.0391    0.0506], ...
	'Tag','box43');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Callback','wangNetwork box42', ...
	'Position',[0.7461    0.0557    0.0391    0.0506], ...
	'Tag','box42');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Position',[0.8242    0.0557    0.0391    0.0506], ...
	'Tag','box44');
	
b = uicontrol('Parent',fig, ...
	'BackgroundColor',[1 1 1], ...
	'Callback','wangNetwork box31', ...
	'Position',[0.7070    0.1063    0.0391    0.0506], ...
	'Tag','box31');
	
b = uicontrol('Parent',fig, ...
	'Position',[0.2598    0.1595    0.2402    0.0481], ...
	'String',{'Randomised phase','All synchronised','All desynchronised'}, ...
	'Style','popupmenu', ...
	'Tag','icmenu', ...
	'Value',2);
	
b = uicontrol('Parent',fig, ...
	'Position',[0.0117    0.1620    0.2168    0.0430], ...
	'String','Initial conditions:', ...
	'Style','text', ...
	'Tag','StaticText4');
	
b = uicontrol('Parent',fig, ...
	'Position',[0.6621    0.0076    0.2012    0.0405], ...
	'String','Weight matrix', ...
	'Style','text', ...
	'Tag','StaticText5');
	
b = axes('Parent',fig, ...
	'Box','on', ...
	'CameraUpVector',[0 1 0], ...
	'CameraUpVectorMode','manual', ...
	'Color',[1 1 1], ...
	'NextPlot','add', ...
	'Position',[0.5664    0.4101    0.4004    0.4810], ...
	'Tag','TimeAxes', ...
	'XColor',[0 0 0], ...
	'XLim',[1 1000], ...
	'XLimMode','manual', ...
	'YColor',[0 0 0], ...
	'YLim',[0 27], ...
	'YLimMode','manual', ...
	'ZColor',[0 0 0], ...
	'ZLimMode','manual');
xlabel('Time [integration steps]');
ylabel('x activity');

b = axes('Parent',fig, ...
	'Box','on', ...
	'CameraUpVector',[0 1 0], ...
	'CameraUpVectorMode','manual', ...
	'Color',[1 1 1], ...
	'NextPlot','add', ...
	'Position',[0.0977    0.4101    0.4004    0.4810], ...
	'Tag','PhaseAxes', ...
	'XColor',[0 0 0], ...
	'XLim',[-3 3], ...
	'XLimMode','manual', ...
	'YColor',[0 0 0], ...
	'YLim',[-1 7], ...
	'YLimMode','manual', ...
	'ZColor',[0 0 0], ...
	'ZLimMode','manual');
	
xlabel('x activity');
ylabel('y activity');


