so I have this 900x23 matrix of linear index values, in which each column (1-23) is a vector of index values for nonzero values for a different matrix. Each of the columns might have a different number of index values, and the rest of the matrix underneath is filled up with zeros so the number of rows is the same across all 23 matrices. Here is the code for how I produced this matrix:
indAcute = ;
for i = 1:size(upperAcute,3)
ind = find(upperAcute(:,:,i));
zer = zeros((900-size(ind,1)),1);
indLong = [ind; zer];
indAcute = [indAcute, indLong];
what I want to do is end up with an Nx23 matrix, where it only includes index values that are present in ALL of the columns. If there's an index value that is missing in one of them, I want to remove it (or replace it with a zero). I was thinking maybe the ismember() function might be useful, but i'm unsure of how to structure my code. Any advice or tips would be greatly appreciated- thanks!