Matlab: How I can make this transformation on the matrix A? (part 2) -


NB: This question is more complex than my previous question:

I have a matrix < Code> one 4x10000 , I want to use it to find another matrix C based on a predefined vector u

I am simple with my problem with a simple example:

a from a matrix

  20 4 4 74 20 20 4 36 1 1 11 36 36 1 77 1 2 3 4 6 7 8 15; 8 4 | 6]  

& amp; : And | : Or

I have an intermediate unit B :

  2 3 4 6 7 8 2 & amp; 4 and 15 7 and 8 4. 6 [20 36 77] 0 1 0 0 1 1 0 1 0 4 [4 1 1] 1 0 0 0 1 0 1 4 [74 11 15] 0 0 0 0 0 0 1 2  

We have put 1, if the value of the first row and vector to the left has created a column in the matrix A .

The last column of the unit is the sum of 1 out of every row b .

Finally, I have made a matrix left in the C , unit b , but only if the sum of 1 is greater than 3 or Is equal.

For my example:

  20 4c = 36 1 77 1  

It was a complex on E and in many restrictions and labeling processes, it would not be efficient as a solution to the previous problem. Here's the code to solve the posted issue -

  find_labels1 = 2: 8; % // Labeling Detection - Main Block find_labels2 = {[2 4 15], [7 8], [4 6]}; % // ... side block A1 = A (1: end-1, :); % // last line A2 = A (end, :); % //% of last% // Built-in columns and the last line [APMTN-Nintendo, Line_ind, INV_LAB] = all (A1 ',' rows'% '' [tmp_sortedval, command_in] = sort (row_in); Unqcols = unqmat_notinorder (command_in, :); [tmp_matches, labels] = ismember (inv_labels, command_in);% // Assign label ctl = numel (unique (label) to each group; Find labelgrp = arrayfun (@ (x) (Label == x), 1: CTL, 'United Nations', 0); // match for the main comparison; // match = BSXFun (@Eq, A2, search_labels1 ');% //' main C = 0: CTL, number (search_label1)); for CTL mainColl (K = :) = any (matches (:, LabelGrap {k}), 2); end% // additional comparison Added work to this that has created an additional complex lens = cellphone ('length', find_labels2); lens (termination) = 1; extcols = nan (ctl, numel (find_labels2)); for k = 1: numel (Find_labels2) idx = find (is2, find2_labels2 {k}); extcols (:, k) = array (@) (ismember (labelgrp {n}, idx)) = lens ( K), 1: ctl). '; % // 'end C = unqcols (sum ([maincols extcols], 2)> = 3, :).' % // '# output at the end  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -