MATLAB: How to flip a row vector without using flip(lr) function flipfliplrrow vector I want to write a function that it can flip a row vector without flip(lr) function. if true % A=[1 2 -3 4] And output must be: B=[4 -3 2 1]end Best Answer Reverse the indices:A = [1 2 -3 4];B = A(numel(A):-1:1)B = 4 -3 2 1 Related SolutionsMATLAB: Hi , i have a matrix and need to extract the column in this way , thank you idx= [ 1 5 9 13 ];A(:,idx) % 4 X 4A(:,setdiff(1:size(A,2),idx)) % 4 X 12 MATLAB: Move a columns to the right The only way I can think of to do it is to use the circshift function on columns 3:5:S = [B(:,1:2) circshift(B(:,3:5),[0 1]) B(:,6)]; Related QuestionFlip elements of a row vectorHow to create a random integernumbers with conditionsHow to copy matrix informationFlip-Flop simulationBit Flip-Bit Negation
Best Answer