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

Sorting a result Matrix

NM_10165576
7-Bedrock

Sorting a result Matrix

I am sorting a result matrix with respect to 5th column.
If A is more than Asreq, i want to get only positive values of 5th column in a sorted way as an output.
If A is less than Asreq, the output matrix should contain only negative values in 5th column and they should be sorted in reverse order. 
Is this possible in Mathcad?

1 REPLY 1

First of all you always should tstae which version of Prime you are using, especially if you don't use the latest (P10 at this time). I guess you are using Prime 9.

 

Then its unclear to me what exactly you are trying to get.

 

Your program calculates a 66x6 matrix "Res".

Then you eliminate the first (all zeros) row of it.

 

And then you compare A.sreq with A (and you are missing the case when they are equal), But A is just the last value of the fifth column (column with index 4) in the 65th row, which happens to be 7.917 cm^2.

Because A.sreq is larger, the whole matrix is reverse sorted by the last columns values and then you return a subset of this matrix, consisting of no more than 31 rows !?

Thats what you have programmed and thats what you get.

 

Is it really intended to compare A.sreq just with the last calculated A value?

And what is your intended output if its not the 31x6 matrix you now get?

I am not sure what you mean by "If A is less than Asreq, the output matrix should contain only negative values in 5th column and they should be sorted in reverse order. ".

Does it mean that you expect the result you have now but without the first eight rows?

And how many rows? Still limited to 31?

 

Would this modification come near to what you are looking for:

Werner_E_1-1721072138901.png

 

Prime 9 sheet attached

 

 

 

Top Tags