Skip to main content
added 36 characters in body
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929

I have 2 tables, the first called GenotypesMaleUp

GenotypesMaleUp = {2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, \
1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, \
2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 2.20853}

and the second called SurvivorsMaleUp

SurvivorsMaleUp = {0.989309, 0, 0.636673, 0, 0.810913, 0.964202, 0.857113, 0, 0.999606, \
0, 0, 0.350838, 0, 0, 0, 0, 0, 0.414982, 0.99347, 0.79752}

They are both the same length. I want to join the first term of GenotypesMaleUp with the first term of SurvivorsMaleUp, and so on for each other term so it would look like

{2.04545,0.989309}, {1.80196,0},(1.70542,0.636673},...

I tried Table[{GenotypesMaleUp, SurvivorsMaleUp}, 1] but got

{{{2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, 
   1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, 
   2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 2.20853}, {0.989309, 
   0, 0.636673, 0, 0.810913, 0.964202, 0.857113, 0, 0.999606, 0, 0, 
   0.350838, 0, 0, 0, 0, 0, 0.414982, 0.99347, 0.79752}}}

as the output, so it just joined the lists together at the end of the first and beginning of the second list.

I have 2 tables, the first called GenotypesMaleUp

{2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, \
1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, \
2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 2.20853}

and the second called SurvivorsMaleUp

{0.989309, 0, 0.636673, 0, 0.810913, 0.964202, 0.857113, 0, 0.999606, \
0, 0, 0.350838, 0, 0, 0, 0, 0, 0.414982, 0.99347, 0.79752}

They are both the same length. I want to join the first term of GenotypesMaleUp with the first term of SurvivorsMaleUp, and so on for each other term so it would look like

{2.04545,0.989309}, {1.80196,0},(1.70542,0.636673},...

I tried Table[{GenotypesMaleUp, SurvivorsMaleUp}, 1] but got

{{{2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, 
   1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, 
   2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 2.20853}, {0.989309, 
   0, 0.636673, 0, 0.810913, 0.964202, 0.857113, 0, 0.999606, 0, 0, 
   0.350838, 0, 0, 0, 0, 0, 0.414982, 0.99347, 0.79752}}}

as the output, so it just joined the lists together at the end of the first and beginning of the second list.

I have 2 tables, the first called GenotypesMaleUp

GenotypesMaleUp = {2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, \
1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, \
2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 2.20853}

and the second called SurvivorsMaleUp

SurvivorsMaleUp = {0.989309, 0, 0.636673, 0, 0.810913, 0.964202, 0.857113, 0, 0.999606, \
0, 0, 0.350838, 0, 0, 0, 0, 0, 0.414982, 0.99347, 0.79752}

They are both the same length. I want to join the first term of GenotypesMaleUp with the first term of SurvivorsMaleUp, and so on for each other term so it would look like

{2.04545,0.989309}, {1.80196,0},(1.70542,0.636673},...

I tried Table[{GenotypesMaleUp, SurvivorsMaleUp}, 1] but got

{{{2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, 
   1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, 
   2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 2.20853}, {0.989309, 
   0, 0.636673, 0, 0.810913, 0.964202, 0.857113, 0, 0.999606, 0, 0, 
   0.350838, 0, 0, 0, 0, 0, 0.414982, 0.99347, 0.79752}}}

as the output, so it just joined the lists together at the end of the first and beginning of the second list.

deleted 107 characters in body
Source Link

I have 2 tables, the first called GenotypesMaleUp

{2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, \
1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, \
2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 2.20853}

and the second called SurvivorsMaleSurvivorsMaleUp

{{0}.989309, {0}, {0}.636673, {0.784521}, {0}.810913, {0.964202}, {0}.857113, {0.304152}, {0}.999606, \
{0}, {0}, {0}.350838, {0.929934}, {0}, {0}, {0.36051}, {0}, {0}.414982, {0}.99347, \
{0.79752}}

andThey are both the same length. I want to join the first term of GenotypesMaleUp with the first term of SurvivorsMaleSurvivorsMaleUp, and so on for each other term so it would look like

{2.04545,0.989309}, {1.80196,0},(1.70542,0},{1.78403,0.784521636673},...

I tried Table[{GenotypesMaleUp, SurvivorsMaleSurvivorsMaleUp}, 1] but got

{{{2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, 
   1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, 
   2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 
   2.20853}, {{0}.989309, {0}, 
 {  0}, {0.784521}636673, {0}, {0.964202}810913, {0}.964202, \
{0.304152}857113, {0}, {0}.999606, {0}, {0}, {
   0.929934}350838, {0}, {0}, {0.36051}, {0}, \
{0}, {0}.414982, {0.99347, 0.79752}}}}

as the output, so it just joined the lists together at the end of the first and beginning of the second list. I think it may have something to do with the brackets but this is the way they are output in my model.

I have 2 tables, the first called GenotypesMaleUp

{2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, \
1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, \
2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 2.20853}

and the second called SurvivorsMale

{{0}, {0}, {0}, {0.784521}, {0}, {0.964202}, {0}, {0.304152}, {0}, \
{0}, {0}, {0}, {0.929934}, {0}, {0}, {0.36051}, {0}, {0}, {0}, \
{0.79752}}

and I want to join the first term of GenotypesMaleUp with the first term of SurvivorsMale, and so on for each other term so it would look like

{2.04545,0}, {1.80196,0},(1.70542,0},{1.78403,0.784521}...

I tried Table[{GenotypesMaleUp, SurvivorsMale}, 1] but got

{{{2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, 
   1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, 
   2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 
   2.20853}, {{0}, {0}, {0}, {0.784521}, {0}, {0.964202}, {0}, \
{0.304152}, {0}, {0}, {0}, {0}, {0.929934}, {0}, {0}, {0.36051}, {0}, \
{0}, {0}, {0.79752}}}}

as the output, so it just joined the lists together at the end of the first and beginning of the second list. I think it may have something to do with the brackets but this is the way they are output in my model.

I have 2 tables, the first called GenotypesMaleUp

{2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, \
1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, \
2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 2.20853}

and the second called SurvivorsMaleUp

{0.989309, 0, 0.636673, 0, 0.810913, 0.964202, 0.857113, 0, 0.999606, \
0, 0, 0.350838, 0, 0, 0, 0, 0, 0.414982, 0.99347, 0.79752}

They are both the same length. I want to join the first term of GenotypesMaleUp with the first term of SurvivorsMaleUp, and so on for each other term so it would look like

{2.04545,0.989309}, {1.80196,0},(1.70542,0.636673},...

I tried Table[{GenotypesMaleUp, SurvivorsMaleUp}, 1] but got

{{{2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, 
   1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, 
   2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 2.20853}, {0.989309,  
   0, 0.636673, 0, 0.810913, 0.964202, 0.857113, 0, 0.999606, 0, 0, 
   0.350838, 0, 0, 0, 0, 0, 0.414982, 0.99347, 0.79752}}}

as the output, so it just joined the lists together at the end of the first and beginning of the second list.

Source Link

How can I pair the values in 2 different tables of the same length together to make a table with 2 variables {x, y}?

I have 2 tables, the first called GenotypesMaleUp

{2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, \
1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, \
2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 2.20853}

and the second called SurvivorsMale

{{0}, {0}, {0}, {0.784521}, {0}, {0.964202}, {0}, {0.304152}, {0}, \
{0}, {0}, {0}, {0.929934}, {0}, {0}, {0.36051}, {0}, {0}, {0}, \
{0.79752}}

and I want to join the first term of GenotypesMaleUp with the first term of SurvivorsMale, and so on for each other term so it would look like

{2.04545,0}, {1.80196,0},(1.70542,0},{1.78403,0.784521}...

I tried Table[{GenotypesMaleUp, SurvivorsMale}, 1] but got

{{{2.04545, 1.80196, 1.70542, 1.78403, 1.79929, 1.91629, 1.82785, 
   1.52171, 1.9913, 1.43151, 1.96283, 1.44868, 2.11816, 2.03117, 
   2.16076, 1.55718, 1.74599, 2.41115, 1.96451, 
   2.20853}, {{0}, {0}, {0}, {0.784521}, {0}, {0.964202}, {0}, \
{0.304152}, {0}, {0}, {0}, {0}, {0.929934}, {0}, {0}, {0.36051}, {0}, \
{0}, {0}, {0.79752}}}}

as the output, so it just joined the lists together at the end of the first and beginning of the second list. I think it may have something to do with the brackets but this is the way they are output in my model.