Can someone please tell me how I can remove the rows that contains only zeros when the first column has the row names? I have tried using the code below found on another Q&A, but it comes back with an error saying 'Error using any. Invalid data type. First argument must be numeric or logical'.
a = glucose 7 2 5 sucrose 0 0 0 amylose 2 3 0 fructose 4 5 0 cellulose 0 0 0 galactose 2 0 1 b = a(any(a,2),:); % What I would like b to look like:
b = glucose 7 2 5 amylose 2 3 0 fructose 4 5 0 galactose 2 0 1
Best Answer