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

Multidimensional nested array

rcallisaya
10-Marble

Multidimensional nested array

Hi , I woul apreciate if someoane can help to convert de nested array in a  matrixnested.png

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you very much, I really appreciate the answer

View solution in original post

15 REPLIES 15

Thank you very much, I really appreciate the answer

How could the program be modified if the origin is 1?

LucMeekes
23-Emerald II
(To:rcallisaya)

As far as I can see the program should function with any value of ORIGIN.
So no modifications needed.

Success!
Luc

Luc is correct - my function should work OK with any value of ORIGIN.

At the top of the function I assign the value of ORIGIN to a variable O.

You must take care that throughout the function you are using O (the letter) and not 0 (zero).

There is not a single zero in this function - whatever looks like a zero is a capital letter O.

Hi, I would appreciate a help to convert the nested matrix of the figure into a matrix.

LucMeekes
23-Emerald II
(To:rcallisaya)

I should think that the very same program can also handle this nested matrix.

You did not provide the matrix, just a picture of it. Assuming you have it as a (nested) matrix, just supply it to the function.

 

Success!
Luc

OK, I see the problems:

1) The routine I provided did not work OK with matrices of just one row or just one column

2) Your matrix PP is even nested one step further than the example you provided in your initial question and so my routine would not deal with it correctly.

 

Any of the following three  functions should fix this and should work with any nesting level and of course any value of ORIGIN - take your choice:

B.png

P.S.: For future questions please keep in mind to

1) say which version of Mathcad you are using (I just see from your screenshot that its real Mathcad and not Prime)

2) always attach your Mathcad worksheet whenever possible and not just pictures!

 

Dear:

 

I appreciate your answer, I have tried it and it works perfectly. I have taken the recommendations into account.
Thank you very much.

Hi, I would like to know how I can generate a vector [cc] as shown in the mathcad sheet. Thank you

You may even try in on multiple nested matrices

B.png

Werner_E
24-Ruby IV
(To:Werner_E)

Modification:

B.png

I would also appreciate knowing how to generate the vector cc1. Thank you


@rcallisaya wrote:

I would also appreciate knowing how to generate the vector cc1. Thank you


You didn't read my answer, did you?

You just type cc1:=unravel1(gdt) (or use unravel2 if you like)

BTW - you don't need to use the function "rowS", you may use the built-in function "rows" instead.

 

The vector cc1 you ask for is the very same as the vector cc you asked before.

Ok. Thanks.

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."