Trouble populating a float array, please help

So I am defining this array

float Latest [8]= {0, 0, 0, 0, 0, 0, 0, 0}; // The string that comes from the processing serial

and then I have a function that receives a serial string from my tablet.

void DataSplit()  // for the tablet string

{
  String c = FromTablet;
  // String c = FromTablet.remove(0,2);
  String M1, M2, M3, M11, M12, M13, M5 , M6, M7;
  //String M14;
  String Time_To_Complete_Str;
  int var = 0;


  if (c[0] == 'g') {            // if the command trigger word is detect

    Serial.println(c.length());  // display start of message
    for (unsigned int i = 1; i <= c.length(); i++) { // a for loop is set to run as many time as the # of characters in a string

      if (c[i] == ' ') { // SPace is used for Separation
        var++;
        // Serial.println (var); // Everytime space is detected, the variable index is incread
      }
      if (var == 1) {    // variable index one is used for base
        M1 = M1 + c[i];    // characters are added as a string to represent base valu
      }
      if (var == 2) { ///ect....
        M2 = M2 + c[i];
      }
      if (var == 3) {   // ect...
        M3 = M3 + c[i];
      }
      if (var == 4) {   // ect...
        M11 = M11 + c[i];
      }

      if (var == 5) {   // ect...
        M12 = M12 + c[i];
      }
      if (var == 6) {   // ect...
        M13 = M13 + c[i];
      }
      if (var == 7) {   // ect...
        M5 = M5 + c[i];
      }

      if (var == 8) {   // ect...
        M6 = M6 + c[i];
      }

      if (var == 9) {   // ect...
        M7 = M7 + c[i];
      }

      if (var == 10) {   // ect...
        Time_To_Complete_Str = Time_To_Complete_Str + c[i];
      }



    }
    /// once these joints are done, variable index are set back to 0, you can add more index for horizontal wrist and gripper



    GoTo_Ang[1] = M1.toFloat();
    GoTo_Ang[2] = M2.toFloat();
    GoTo_Ang[3] = M3.toFloat();


    GoTo_Ang[11] = M11.toFloat();
    GoTo_Ang[12] = M12.toFloat();
    GoTo_Ang[13] = M13.toFloat();

    GoTo_Ang[5] = M5.toFloat();
    GoTo_Ang[6] = M6.toFloat();
    GoTo_Ang[7] = M7.toFloat();
    Tm = Time_To_Complete_Str.toFloat();
    //Serial.println (Tm);
   // Angle_Speed (GoTo_Ang[7], 360, 7);
    //delay (3);

    //EvBody_Go (GoTo_Ang[1], GoTo_Ang[2], GoTo_Ang[3],
     //          GoTo_Ang[11], GoTo_Ang[12], GoTo_Ang[13], GoTo_Ang[5], GoTo_Ang[6], Tm);

   Latest [8] = (GoTo_Ang[1], GoTo_Ang[2], GoTo_Ang[3], GoTo_Ang[11], GoTo_Ang[12], GoTo_Ang[13], GoTo_Ang[5], GoTo_Ang[6]) ; 


     for (int i= 1;   i<14; i++)
     {
     Serial.println (i);
     Serial.println (Latest[i]);
     }

     
     for (int i= 1;   i<14; i++)
     {
     Serial.println (i);
     Serial.println (GoTo_Ang[i]);
     }
    //Mini_Steps (Latest,  Tm);
    var = 0;

    //StepNo = 0;
  }  // if g end
}

when I print the GoTo_ang array all values are correct, but the "Latest " array is showing only zeros:

From the serial monitor:

FromTablet: g -27.1, -50.0, 22.9, 54.8, 77.7, 22.9, 1.8, -45.8, 0.0, 600.0);
64
1
0.00
2
0.00
3
0.00
4
0.00
5
0.00
6
0.00
7
0.00
8
-45.80
9
0.00
10
0.00
11
0.00
12
0.00
13
0.00
1
-27.10
2
-50.00
3
22.90
4
0.00
5
1.80
6
-45.80
7
0.00
8
0.00
9
0.00
10
0.00
11
54.80
12
77.70
13
22.90

Where am I going wrong? Thanks

Latest [8] = (GoTo_Ang[1], GoTo_Ang[2], GoTo_Ang[3], GoTo_Ang[11], GoTo_Ang[12], GoTo_Ang[13], GoTo_Ang[5], GoTo_Ang[6]) ;

You can't do run-time array assignment that way. It's only valid for compile-time initialization. You have to index the array's elements individually.

If the elements of that you need in the GoTo_Ang array were contiguous, you could also use memcpy().

Latest [8] = (GoTo_Ang[1], GoTo_Ang[2], GoTo_Ang[3], GoTo_Ang[11], GoTo_Ang[12], GoTo_Ang[13], GoTo_Ang[5], GoTo_Ang[6]) ;

You mean:

  Latest[0] = GoTo_Ang[1];
  Latest[1] = GoTo_Ang[2];
  Latest[2] = GoTo_Ang[3];
  Latest[3] = GoTo_Ang[11];
  Latest[4] = GoTo_Ang[12];
  Latest[5] = GoTo_Ang[13];
  Latest[6] = GoTo_Ang[5];
  Latest[7] = GoTo_Ang[6];

Look up function strtok

Why the contrived split out into variables M1, M2, M3, M11, M12, M13, M5 , M6, M7 in the first place?
Inside the loop, split into individual fields (strtok will do that for you).
Convert to float (see atof function).
Depending on value of "var", insert that into the correct array position.

Job done.

Any time you find yourself suffixing a variable with a number, you probably doing it wrong: That's what arrays are for.

Yes, that is what I did, equaled them one by one and it worked.

Thanks

if (c[0] == 'g') {     that should be if (c.charAt(0) == 'g') {     You can not access characters of a String as if it is a 'character array' (does that even compile ?

Deva_Rishi:
if (c[0] == 'g') {      You can not access characters of a String as if it is a 'character array' (does that even compile ?

Yes, you can: