MATLAB: How to create a function that interweaves two vectors of 1xN dimensions interweave How do I create a function that interweaves two vectors of 1xN dimensions? Best Answer As one of the ideas:v1 = [1, 2, 3, 4]v2 = [5, 6, 7, 8, 9, 10]lv1 = length(v1)lv2 = length(v2)v = zeros(1,max(lv1,lv2)*2)v(1:2:lv1*2) = v1v(2:2:lv2*2) = v2 Related SolutionsMATLAB: How to define an arbitrary constant for equations If you are talking about making an assumption, you can do it as follows:v1=6;v3=18;syms v2 v4 v5 v6eqn1= -v4+v5==-v3;eqn2= -v2+v6==v3;eqn3= -v5-v6==-v1;assume(v6~=0)[v2 v4 v5 v6]=solve(eqn1, eqn2, eqn3);[v2 v4 v5 v6] MATLAB: Produce a matrix from pointwise outer product from vectors of different length u * vwould be the same asu * [v1', v2', v3']which would be the same as[u * v1', u*v2', u*v3']so just go ahead and use u * v Related QuestionHow to concatenate string vectors of unequal lengthMatlab: element wise complex conjugate transposeMatch time stamps indexFill a vector with two vectorsCross product of two vectors(function)
Best Answer