edit: Forgot to add Mathematica in the title. Sorry!(adsbygoogle = window.adsbygoogle || []).push({});

Hi everyone.

I mined a lot of data and want to analyze it in Mathematica.

The data is of the form

{{x11, y11, x12, y11, x13, y13},{x21, y21, x22, y22}....}

meaning that each set of x,y pairs is not necessarily the same size.

Maybe I'm just dense, but I'm having a tough time writing it to my array correctly.

I'm getting the 'Part specification does not exist' error. I don't want to declare cleanData as a vector because I end up with empty spaces.Code (Text):For[i = 1, i <= Length[rangeData], i++,

{

For[j = 1, j <= Length[rangeData[[i]]], j++,

{

If[rangeData[[i, j]] >= 0,

{

index = Mod[j, 2] + 1;

cleanData[[i, j, (Mod[j, 2] + 1)]] = rangeData[[i, j]];

}];

}];

}];

Any suggestions?

Thanks

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Declaring/filling arrays of arbitrary size in Mathematica

**Physics Forums | Science Articles, Homework Help, Discussion**