یک تابع به نام myfun درست می کنیم و تعداد ستون b را به اون می دهیم تا هم b ایجاد بشه و هم c

function [b,c]= myfun(a,bcols)
i0=randperm(cols(a));
[ii,i1,jj]=unique(a(:,i0(1:bcols)),'rows');
[ii,i2,jj]=unique(a(:,i0(bcols+1:cols(a))),'rows');
i3=intersect(i1,i2);
i5=i3(randperm(35));
b=a(i5,i0(1:bcols));
c=a(i5,i0(bcols+1:cols(a)));
end
a=rand(70,12);
[b,c]=myfun(a,7);