0
votes

I am using the Cobra Toolbox in MATLAB to perform a double gene knockout study and output for growth ratios is a 100 by 100 matrix called grRatioDble. I need to find the row and column index for elements of this matrix which are <0.001, excluding the rows which were essential on single gene knockout. I have a one-column matrix of the row indexes that I want to exclude. Is there an easy way to do this?

(NB: I cannot just remove the unwanted rows from the matrix as then row, column index changes for the remaining cells)

1
This resource is more about programming than science. If you need some help with the code provide it.Teivaz
My question is not really about the science, I just want to know how to extract the row and column indexes of those elements from a Matlab matrix.S. Lundregan
Actually yes, for several hours now. I could not find the answer I wanted, hence asking here... I didn't find the answer on that link either.S. Lundregan
Basically you are asking "How can I find the indexes of elements that are less than a value?" And this is described in the page I provided. If there is a problem with your specific task then provide the code you've tried and we'll try to figure out how to fix itTeivaz

1 Answers

0
votes

This piece of code should do the work:

  1. Get all row/col indexes where grRatioDble<0.001:

    [row,col] = find(grRatioDble<0.001);
    
  2. Exclude unwanted rows (say the vector containing unwanted rows is rows2exclude):

    row = row(~ismember(row, rows2exclude));
    col = col(~ismember(row, rows2exclude));