MATLAB: Making an array ‘skip’ some numbers array Hi everyone, I am trying to make an array that looks for example like this: x= -4 -3 -2 2 3 4 So in this example I skipped the -1 the 0 and the 1. How can I make somethink like this in matlab? Thanks in advance Best Answer left_x = -4:-2; right_x = 2:4; x = [left_x right_x]; You could do also something like: x = [-180:10:-110 -105:5:-45 -44:44 45:5:105 110:180]; Related SolutionsMATLAB: How to extend array repelem(A,B) MATLAB: Best way to create a matrix of points A=[-5 -4.5 1.5 2; -5 -4.5 2 2.5; -5 -4.5 2.5 3; -4.5 -4 1.5 2; -4.5 -4 2 2.5; -4.5 -4 2.5 3];points = unique([A(:, [1, 3]); A(:, [1, 4]); A(:, [2, 3]); A(:, [2, 4])], 'rows')is the simplest though posibly not the most efficient.edit: this may be marginally more efficient, though more obscure:points = unique(reshape(A(:, [1 1 2 2 3 4 3 4])), 'rows') Related QuestionDeleting specific dublicates out of an arrayProblem Expanding a MatrixHow to fill values between two values.How to modify a matrix to change the entries >=0 and multiply it by 5 AND to change the entries <0 and add 2 to those entriesHow to create an array that counts the number of consecutive repeating numbers in a given arrayHow to Assemble the matrix shown in the image on Matlab for any number of nodes
Best Answer