Asked by BANI tita
on 17 Oct 2012

hi, I have a matrix divided into two groups A and B point, I have mask of A and B, my question is how to divided n matrix and putting points in Group A in a vector and points of B in the other this program gives me only the results of the first matrix (t = 1)

%-------------------------------- for t=1:220 PAA=[]; PTT=[]; m=Im(:,:,t); % image de 220 bandes m=m(:); ff=masquePA; ff=ff(:); PAA= [PAA;nonzeros(m.*ff)]; bb=masquePT; bb=bb(:) PTT=[PTT;nonzeros(m.*bb)] end %---------------------------------

*No products are associated with this question.*

Answer by Image Analyst
on 17 Oct 2012

Well it must be because nonzeros(m.*bb) is null. And the only way that can happen is if masquePT is all 0 or m is all 0, or each is zero where the other has some non-zero values. Make a mask for PT, masquePT, that has some non-zero values in it. Then, make sure your channels 2-220 of m have non-zero values in it at the same places where your mask has non-zero values. Then PTT will have some values in it.

Show 2 older comments

Image Analyst
on 17 Oct 2012

Opportunities for recent engineering grads.

## 0 Comments