function S1capS2=myintersect(S1,S2)

[~,dim1]=size(S1);
[~,dim2]=size(S2);
p1=S1*[eye(dim1) zeros(dim1,dim2)];
p2=mynull([S1,S2]);
p1p2=p1*p2;
S1capS2 = mycolspace(p1*p2);

end