MATLAB: Can somebody explain me this answer matrix a=[1 2; 3 4]; a(3*ones(2)) ans= 2 2 2 2 Best Answer The code copies the third element of a as 2 by 2 matrix, see the below example:>> aa = 1 2 3 4>> a(:)ans = 1 3 2 4>> a([3,3;3,3])ans = 2 2 2 2>> Related SolutionsMATLAB: How to find the number of occurrences of a particular sequence inside the cell array C = {[1; 2; 3]; [1; 2; 3; 4]; [4; 1; 2; 3]; [1; 2]};sequence_check = [1; 2; 3];n = sum(cellfun(@(x) ~isempty(strfind(x.',sequence_check.')), C)) MATLAB: How to rearrange an array? rows to columns aa=a' Related QuestionAdd 2 to the element in the 2nd row and 3rd column of given matrix.How to sort a matrix by a predefined orderWhat does X(sel,:) outputs
Best Answer