MATLAB: How do i find the 4 element in a matrix elementfindmatrix i need help on writing a script that finds the 4 element in a matrix meaning i need the element in the first row in the fourth column I am required to use the find() function if that helps Best Answer eg:A = randi(45,5,4)out = A(1,4)ORi1 = reshape(1:numel(A),size(A,2),[]).'out = A(find(i1 == 4))orout = A(i1 == 4) Related SolutionsMATLAB: Find indices of one array in another array. [~,idx]=setdiff(A,B,'rows');idx_rows=setdiff(1:size(A,1),idx) MATLAB: Element by Element Subtraction Try this:a= [1,2,3,4,5] b= [-1,-2,-3]c = a' - b;c = c(:)'You getc = 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8in R2016b (I believe) or later that has automatic expansion capability. Related QuestionHow do i find matching row from an arrayPosition of element in a rowUsing FIND in 3D matrixFind other element in row of a matrixQ matrices element matchingHow to skip the index of arrayElement by Element Multiplication
Best Answer