MATLAB: I have A=[ 1 3 5 7] B=[2 4 6 8] i need to get answer like c=[1 2 3 4 5 6 7 8] pl help me insert data in to other pl help me to solve this Best Answer c = zeros(numel(A) + numel(B),1);c(1:2:end) = A;c(2:2:end) = B; Related SolutionsMATLAB: Let consider a matrix A= [ 2 4 8 6 7 8] and mean of 1&2 , 3&4, 6&8 elements could be farmed as second matrix like B= [(2+4)/2=3 (8+6)/2=7 (7+8)/2=7.5] i.e B= [3 7 7.5] now i need a final matrix like A=[2 3 4 8 7 6 7 7.5 8] A= [ 2 4 8 6 7 8] ;A = reshape(A,2,[]) ;B = [2 3 4 8 7 6 7 7.5 8];avg = mean(A) ;C = zeros(size(A,1)+1,size(A,2)) ;C(2,:) = avg ;C(1:2:end,:) = A ;C = C(:)'; MATLAB: Divide an array in n different arrays V = [1 1 1 1 1 1 6 6 6 6 6 6 6 6 6 3 3 3 3 3 3 3 5 5 5 5 5 5 5 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 4 4 4 4 4 4 4 4 4 4 2 2 2 2 2 1 1 1 1 1 6 6 6 6 6 6 6]A = [1 3 46 5 20 8 00 9 0][~,c,a] = find(A);[~,i] = ismember(V,a);g = c(i);d = find([true; diff(g); true]);c = mat2cell(V,1,diff(d));c{:} Related QuestionGenerate all possible combinationsCreate a new array from an intersection of two previous arrays
Best Answer