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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Unnesting arrays automatically

Raiko
16-Pearl

Unnesting arrays automatically

Hi fellow MCers,

is there an automated way to "unnest" an array?

I have a huge amount of excel files from which I read in some data. These are all displayed in a nested array (see attached image). As I have really many files I don't wish to call up every single array element manually.

Thanks

Raiko

P.S.

I have made a search for this topic beforehand, but the attachements are missing in the relevant posts 😞

FURTHERMORE

Why is it that the time stamps are put into a nested array instead of a "simple" array?

I'm reading in the time line information from Excel files and had hoped to arrange them according to the time differences. However, in order to compute them I need to access the cells of a nested array. Displaying a nested array is fine but doesn't exactly solove my problem.

Any ideas?


Raiko

1 ACCEPTED SOLUTION

Accepted Solutions
FDS
12-Amethyst
12-Amethyst
(To:Raiko)

Maybe you could try format -> results -> Display Options -> check Expand nested arrays

View solution in original post

10 REPLIES 10
FDS
12-Amethyst
12-Amethyst
(To:Raiko)

Maybe you could try format -> results -> Display Options -> check Expand nested arrays

Raiko
16-Pearl
(To:FDS)

Hi desomer,

thank you very much - that did the trick. Checking unnest array and displaying said array as a matrix worked fine.

Cheers

Raiko

RichardJ
19-Tanzanite
(To:Raiko)

Your "i" should run from 0 to 16, not 1 to 17 (the origin for al arrays is 0). That's why the first element of your array is a zero.

Change XY[i to XY Ctrl 6 i (column operator). The return the transpose of XY. Your array should then be a vector (I think - I haven't tried it to be certain)

MikeArmstrong
5-Regular Member
(To:Raiko)

Please post a worksheet if possible.

Mike

Here we go

Raiko

Raiko Milanovic wrote:

Here we go

Raiko

Here, it goes nowhere !

Post a work sheet wherein the results are nested, and don't zip !

You have a folder, what's a folder ? an empty folder,

a folder of what ? If you have data in that folder, put them in a

Mathcad data table. How can we know what has to be unested ?

Vertical nest ? horizontal nest ?

Easy Jean !

You've already helped me with your posted gif.

Is there a problem in this forum with attaching a zip file I'm not aware of?

For convenience I've added some Excel files so you can have the results immediately in the work sheet.

Anyhow, you have helped to solve my problem.

Thanks

Raiko

MikeArmstrong
5-Regular Member
(To:Raiko)

Raiko Milanovic wrote:

Here we go

Raiko

Raiko,

Have a look at the attached image.

I have changed the path of the file to suit my works computer, just ignor those changes.

Mike

Message was edited by: MIke Armstrong

You seem to have a simple extract, maybe not done correctly. Lot of Mathcad results come out nested. Sometimes it's possible to unest from the costruct, sometimes it is not or messy.

Cher Jean

merci beaucoup pour votre aide

Raiko

Top Tags