m=40;m_a=20;
n=22;n_a=5;n_b=5;
rand('seed',sum('flow_ctrl'));
R = [round(rand(m_a,n_a)) zeros(m_a,n_b) round(rand(m_a,n-n_a-n_b));
    zeros(m-m_a,n_a) round(rand(m-m_a,n_b)) round(rand(m-m_a,n-n_a-n_b))];
c = 5*rand(m,1);