cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Unstack/delete rows/columns

Dumitru
1-Newbie

Unstack/delete rows/columns

New Picture (9).jpg

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)...

New Picture (10).jpg

5 REPLIES 5
MikeArmstrong
5-Regular Member
(To:Dumitru)

Could you post a worksheet? It will be much more helpful


Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

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"

StuartBruff
23-Emerald II
(To:Dumitru)

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) ?

MikeArmstrong
5-Regular Member
(To:Dumitru)

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

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

Top Tags