function [q,cv_scpc,r] = scpc_parms(distmat,cbar,cmax,qmax,alpha)
 
 W_scpc = getW(distmat,cbar,qmax);
 omega_mat_scpc = form_omega_mat(cbar,cmax,qmax,W_scpc,distmat);
 [q,cv_scpc]=findqcv(omega_mat_scpc,alpha);
 r = W_scpc(:,2:q+1); % Weights for PC
 
end

