MATLAB: How can extract values from array array I have an array as X = [0 0 1 3;5 0 2 1;-1 0 1 7;0 1 8 3]; I wante extract the values that are 0's and 1's by the same order of them in X in other array such as Y = [0 0 1 0 1 0 1 0 1] please reply for my question thanks Best Answer x1 = X'x1 = x1(:)'out = x1(x1 == 0 | x1 == 1) Related SolutionsMATLAB: Place array in a matrix Perhaps I'm misunderstanding but if x = [1.0000 0 0.5000 1.0000 0.5000 1.5000 0 -1.0000 -1.0000 1.0000 0.5000 -1.0000];which is a 6x2 array, then wouldn't x*x'be the desired 6x6 array? MATLAB: How extract value form an array Maybe you want matrix(ind,:) Related QuestionHow to extract number from cell arrayBoth primal and dual problems are infeasible2D array
Best Answer