I used both answers below! Thank you!
jetcustom=jet(n);
r1=K(1,:);
colors = interp1(linspace(-1, 1, n), jetcustom, r1.');
figure()
set(gca, 'ColorOrder', colors , 'NextPlot', 'replacechildren');
x=1:k;
for i=1:n
y=K(:,i);
I=ismember(i,Con);
J=ismember(i,Ex);
if I==1
plot(x,y,'--');
elseif J==1
plot(x,y);
end
hold on
end
xlim([1 k]);
ylim([-1.5 1.5])
colormap(jet(10))
cb=colorbar;
caxis([-1 1])