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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Translate the entire conversation x

Creating a new matric with specific row from a larger matrix

ptc-5335587
1-Visitor

Creating a new matric with specific row from a larger matrix

This is a question about matrices. I need to select specific rows from a matrix/vector, returning a matrix/vector that has less rows than the original. So, i started with 64 rows of data and reduce that to smaller number of row say 32. Attached is the file. I would appreciate the help.

thanks

pk

4 REPLIES 4
Werner_E
25-Diamond I
(To:ptc-5335587)

You don't start with 64 rows but according to your sheet you have 66 rows!?

You don't decribe in your how you would like to reduce the number of rows and it is not to be seen from your sheet either. I just see a lot of range variables used in a rathe strange way (and sure not giving yo what you want) and nothing which would ressemble an algorithm to reduce the size of the array. You are constructing two vectors of nearly equal length as PKP which consists of the elements of PKP with every second set to zero (default value). And the program to create SX3 uses an undefined variable SXX1 and therfore fails.

So what are you trying to do?? Which rows would you like to delete? Every second? Or every line which fulfills a given constraint? Or are you simply trying to strip the headers of PKP?

The topic says you want a new vector consisting of "specific" rows - you will have to specify "specific".

Looks like you're trying to take every second row?

Fred Kohlhepp wrote:

Looks like you're trying to take every second row?

Thats a plausible guess but I thought Paul would be interested enough to tell us himself what he is looking for exactly. As far as I can tell from the sheet it looks like he is interested in the second column only.

BTW, your routine is missing one row ("B319").

FRED

THANK YOU FOR THE HELP. YOUR PROGRAM SOLVES THE PROBLEM. I HAVE BEEN TRYING TO SORT ON A QUANTITY IN LIEU SELECTING THE SPECIFIC ROW. BUT THIS WORKS WELL.

THANK YOU AGAIN FOR THE HELP. I AM NEW TO MATHCAD, IT IS A POWERFUL TOOL. BUT I HAVE TO LEARN TO USE IT.

PK

Announcements

Top Tags