I want to return the rows in a cell array that meets a condition that does everything (but variables) Lines are repeated. For example, if my data is synchronized to X, Y, Z, then I divide into pieces where each piece {i} is a specific z, I can do something like this.
1,3, 10, 1,4,10, 1,5,10, 2,3,10, 2,4,10,1,1,10,
< P> I want the maximum and minimum Y value for each x, in this case I want 1, 3, 4, 5, 6 rows. Now I see such a code
idx = slice {i} (start: finish, 2) == miny | Piece {i} (start: finish, 2) == maxy; Return = slice {i} (idx, :);
But line piece {i} (idx, :) looks through the whole array from the beginning, I want to restrict this line to a certain subset.
Something like this: piece {i} (idx, start: finish)
but it does not work.
Am I missing some syntax or do I need to contact the routine differently? (I know that I have not provided enough information to help change the approach, but I am assuming that there is a way to restrict some Indian policies to do this)
Edit: < / P>
I found an alternative solution by creating
dummy = slice {i} (start: end, :);
And then just return to the dummy matrix.
If it works for you -
% / / Convert a% numeric array slice value = cell 2 matte (%) to%% // Global (real) line indices with local maximum-minimum index to attract sledging or offset 1 = [0; Local (maximum: 1,)) = ~ (unique (slicenum (, 1))% / local maximum and get minimum line index max_row_ind = accumarray (unqX, slicenum (:, 2), [], @ max_ind) + Offset 1 Mi_O__In = Deposit (Unqx, Slasineum (,, 2), [], @min_ind) + Offset 1% // Get the global line index and use the index in the slash for messages for output max_y_slice = Slicenum ( Max_row_ind, :) min_y_slice = slicenum (min_row_ind, :)
Associated function -
function ix = max_ind (array1) [~, ix] = max(Array1); return; function ix = min_ind (array1) [~, ix] = minutes (array1); return;
Comments
Post a Comment