Bluebit Software
Bluebit Software Support Forum
 Home          Members     Calendar     Who's On

Welcome Guest ( Login | Register )
        



Drop a matrix column Expand / Collapse
Message
Posted Monday, November 27, 2006 8:28 AM Post #143
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
What is the best way to drop columns in a matrix?

This carries on from my previous question about variance. I have a matrix M and i want to delete any column in it that has a variance of 0. I have got the check for zero variance working but i'm unsure as the best way to get rid of columns.

My current way of thinking is to move all the columns of M that have zero variance to the far right of the matrix and then to use the submatrix method to take only the left-most columns that i want.

I am not sure this is the best way to do things though as it seems a bit time consuming creating a permIndex to move every single column to a new place.
Posted Monday, November 27, 2006 8:42 AM Post #367
 

Bluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit Support

Try using SwapCols method to exchange column data.

Trifon Triantafillidis

Lead Developer

Bluebit Software

Posted Monday, November 27, 2006 9:32 AM Post #368
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
i don't want to swap a column with a column at the far right of the matrix. I want to be able to move the column to the far right of the matrix so i can take a submatrix that doesn't include the columns i have moved to the far right of the matrix. (essentially deleting any column that i have moved and shifting all the other columns however many columns to the left)
Posted Tuesday, November 28, 2006 7:21 AM Post #370
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
its okay now, ive decided the best way to do it was to build a permutation index by iterating through the array and building a new array. would be easier though if there was a simple delete column/row method.....
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Trifon

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 11:53am

Powered by InstantForum.NET v4.1.4 © 2010
Execution: 0.453. 8 queries. Compression Disabled.
.NET Matrix Library