MATLAB: Fill a vector with two vectors arraysMATLABmatricesvectors Hello, I have two vectors, Ex: V1 = [3 8 6 7 ] and V2= [1 5 9 4 ]. With V1 and V2, I would like to create the following vector: Result = [ 8 5 6 9 7 4]. How can I do this? Thanks in advance, Eva Best Answer V1 = [3 8 6 7]V2 = [1 5 9 4]V = reshape([V1;V2],1,[])V = V(3:end)results in:V1 = 3 8 6 7V2 = 1 5 9 4V = 3 1 8 5 6 9 7 4V = 8 5 6 9 7 4 Related SolutionsMATLAB: Matrix conversion I= [2 3 4; 5 6 7; 8 9 0];[m n] = size(I);ShX = 2;ShY = 2;r = m*ShX;c = n*ShY;J = zeros(r,c);for x = 1 : m for y = 1 : n J((x-1)*ShX+1 : x*ShX, (y-1)*ShY+1 : y*ShY) = I(x,y); endend MATLAB: How to create table and export it to Excel Use xlswrite?v1 = [1 2 3 4 5]; v2 = [6 7 8 9 10]; v3 = [11 12 13 14 15];xlswrite('somefile.xlsx', [v1;v2;v3]); Related QuestionIs it possible to extract the values with a vector of indices for each row without using the for statement from the matrixHow to shuffle two vectorsHelp running Matlab scriptGeneration of a matrix based on a defined order of numbersProduce a matrix from pointwise outer product from vectors of different length
Best Answer