MATLAB: Array slicing scattered rows array slicingscattered rows How can I select scattered rows from an array? Suppose A = rand(6,6) now how can I select everything except the second and fifth row of A? Best Answer You can use setdiff()A = rand(6,6);idx = setdiff(1:size(A,1), [2 5]);B = A(idx, :); Related SolutionsMATLAB: Sliced variables To slice the variable 'a', you need to use a subscript list that contains:One instance of the loop variableOther subscripts which are either constant literal values or ':'So, for example, in the following case, 'a' will be a sliced output:parfor n = 1:35 tmp = 90 * ones(1, 15); a(n, :) = tmp;endwhich creates 'a' as a 35x15 matrix with each element containing the value 90. MATLAB: Extracting Slices From Slice Function use the vector slicing to get one slice, Let V is the input volume. e.gS=V(:,:,1);use 'imshow' or 'imagesc' functions to view the slice as image Related QuestionHow to replace repeating no.s in an array by distinct no.Integration of scattered data
Best Answer