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

10-Marble

## Multidimensional nested array

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

1 ACCEPTED SOLUTION

Accepted Solutions
10-Marble
(To:Werner_E)
`Thank you very much, I really appreciate the answer`
15 REPLIES 15
24-Ruby V
(To:rcallisaya)
10-Marble
(To:Werner_E)
`Thank you very much, I really appreciate the answer`
10-Marble
(To:Werner_E)

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

23-Emerald III
(To:rcallisaya)
As far as I can see the program should function with any value of ORIGIN.
So no modifications needed.

Success!
Luc
24-Ruby V
(To:rcallisaya)

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.

10-Marble
(To:Werner_E)

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

23-Emerald III
(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

24-Ruby V
(To:rcallisaya)

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:

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!

10-Marble
(To:Werner_E)

Dear:

```I appreciate your answer, I have tried it and it works perfectly. I have taken the recommendations into account.
Thank you very much.```
10-Marble
(To:rcallisaya)

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

24-Ruby V
(To:rcallisaya)

You may even try in on multiple nested matrices

24-Ruby V
(To:Werner_E)

Modification:

10-Marble
(To:Werner_E)

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

24-Ruby V
(To:rcallisaya)

@rcallisaya wrote:

I would also appreciate knowing how to generate the vector cc1. Thank 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.

10-Marble
(To:Werner_E)

Ok. Thanks.

Announcements