function plot_controls(q,labels,name,ticks,I,msl,side)

if isa(labels, 'char')
	labels = { labels };
end


T=q.data(:,1);
LR={'l','r'};

d=zeros(length(I),length(labels));

for i=1:length(labels)
	index=find_columns_by_label(q.labels,[labels{i} '.*' LR{side} '.excitation']);
	dd=sum(q.data(I,index),2);
	d(:,i) = sum(q.data(I,index),2);
end

plot(T(I),d,'r','LineWidth',2);
if length(labels)>1
	legend(labels,'Interpreter','none');
end

set(gca,'XTick',ticks(side).values, 'XTickLabel', ticks(side).labels);
xlabel('% Gait cycle');
ylabel('Muscle excitation');
axis([T(I(1)) T(I(end)) 0 1]);
%title([name ' - ' upper(LR{side})],'FontSize',20);
title(name,'FontSize',20);
