So far I have this but it's not working when the two vectors are different lengths:
function [C] = makemat(A, B)if length(B)>length(A) for n=length(B) if ~A(n) A(n)==0 end endelseif length(A)>length(B) for m=length(A) if ~B(m) B(m)==0 end endendC(1,:)=AC(2,:)=Bend
Best Answer