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

extracting specific matrix

mostafaelhodiry
6-Contributor

extracting specific matrix

hai all

 

how to extract specific raws from phi matrix , i am trying to solve this by using this equation in phi x Capture.JPG

8 REPLIES 8

It not clear what you'd like to achieve.

You should more clearly show what the result you are looking for should look like.

Your screenshot does not show the value of a, I guess its 3 (or less). So you sure should attach your worksheet - maybe not the full one but just a modified sheet to demonstrate what you are after.

Do you just want to extract the 3 non-zero rows? But your program suggest you are just interested to up to the 3a-1 column, not the full rows!?

If your goal is to extract just the non-zero rows you may try a combination of "match" and "trim".

 

I WANT TO EXTRACT THE DATA FOR SPECIFIC ROWS WHICH INCLUDE 0,2..N-1 

FIRST MATRIX phi1 ==== EXTRACT THE DATA FOR ROWS WHICH INCLUDE 0,3..N-1 

SECOND MATRIX  phi2==== EXTRACT THE DATA FOR ROWS WHICH INCLUDE 1,4..N-1 

SECOND MATRIX  phi3==== EXTRACT THE DATA FOR ROWS WHICH INCLUDE 2,5..N-1 

 

SINCE N=3*A , AND ALL CELL  NOT EQUAL ZERO Capture.JPG

I am not sure waht you try to accomplish.  Use the submatrix function to extract a specific rows and columns

Please stop shouting, we can hear you loud and clear when you talk lowercase...

LM_20180901_Matrix.png

You should be able to program this in Prime.

 

Success!
Luc

ok , i don't about if i write by using big letters , this mean i am shouting 

thanks for ur advice and helping me for solving this problem 

The line in your program

 

                phix <--  phi[i,j

 

Assigns a single element value to phix.  This program will always return a single number, not a row.

 

           

Hi,

 

You just need to add subscripts to phix in the program.   i/3 and j

 

Capture.JPG


@terryhendicott wrote:

Hi,

 

You just need to add subscripts to phix in the program.   i/3 and j

 

 


Better use trunc(i/3)  (and it should be Phi[i,j and not Phi[i[j).

 

What confuses me in the original screenshot provided by mostafaelhodiry is that his program returns 0 as value.

The value of a seems to be a=3 (he wrote n=3*a and n seems to be the number of rows in his matrix which is 9).

So the last value assigned to Phix is Phi[8,8 and this value would be returned. But Phi[8,8 is -0,185 and not 0 !?

So unless he is using a strange number format (Decimal with 0 as Decimal Precision) for the output  ... ???

 

Announcements

Top Tags