Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
How can I delete (in a programme) rows in a matrix which has all the elements in the forementioned rows equal to zero?
Furthermore, is it possible to extract the positions (in a matrice) for elements meeting a condition (i.e. my "Position1" checks for each column if there is an element meeting that condition; if it is, it's position becomes the new value ~ element = row no. The end to that is that there are many rows with "zero" as elements and I need to delete them to get a new matrice - i.e. starting with row 36 to the last ~ no change in no of colums assuming in each row there is an element meeting the condition. Should also that not be the case is it possible to further eliminate columns?)
Kind regards, Dumitru
P.S. "Position20" calculates correctly the value for which there are the most lines of non-zero elements. Still I can't seem to subtract the needed matrice ~ "Position22" (incorrect no of rows and columns)...
Could you post a worksheet? It will be much more helpful
Mike
I managed in the end to get it done...still the question remains.."is it another way easier" and "what about deleting columns and extracting their no in the original matrice"
Dumitru Moldovan wrote:
I managed in the end to get it done...still the question remains.."is it another way easier" and "what about deleting columns and extracting their no in the original matrice"
Dumitru,
Unfortunately, your worksheet isn't working correctly in my M11 (I think I've got a set up problem). However, regarding your original request, the attached worksheet shows one way to identify all-zero rows and columns and then use that information to delete those rows/columns (or, rather, construct arrays that leave them out).
Stuart
Dear Stuart, thanks for all the help. BTW is is possible to extract a combination of one scalar value and a matrice (i.e., to know the rows and columns with zero elements that have been eliminated from the initial matrice in combination with the resulting matrice ~ after deletion) ?
Dumitru Moldovan wrote:
Dear Stuart, thanks for all the help. BTW is is possible to extract a combination of one scalar value and a matrice (i.e., to know the rows and columns with zero elements that have been eliminated from the initial matrice in combination with the resulting matrice ~ after deletion) ?
Dumitru,
Can you provide an example of exactly what your after?
Mike