MATLAB: Perform Operation on only even rows. circshift How would I go about performing an operation only on the even rows. For example, you have matrix A and you want to cirshift only the even rows. Thanks Best Answer A=randi(9,10,4)idx=2:2:size(A,1);Ae=A(idx,:)Ae1=circshift(Ae,[0 -2])A(idx,:)=Ae1 Related SolutionsMATLAB: Unknown operation performed. This is called logical (or boolean) indexing.https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.htmlYour A matrix is filled with booleans.B is now a vector that has all the elements of S that correspond to the same indexes as the Ones in A.C is now a vector that has all the elements of S that correspond to the same indexes as the Zeros in A.a = logical([1 0 0 1; 0 0 1 0])s = [1,2,3,4;5,6,7,8]s(a)ans = 1 7 4 MATLAB: Uitable operation data = cell(3,15);data{1,1} = rand; data{1,6} = rand;data{2,7} = rand;data(cellfun(@isempty,data)) = 0;uitable(..., 'Data', 'data'); Related QuestionMatrix operationCell operationMatrix operationXOR operationMatrix operationVector operations
Best Answer