Errore while compiling - scalar object '***' requires one element in initializer

Hi, while compiling (the code is not complete but due to my inexperience i’m tryng to built it piece by piece and check that each piece works fine) I got this message:
scalar object ‘Rotation’ requires one element in initializer
I don’t really know where is my error, I even tried to check online for similar compiling error but it wasn’t helpful.

#include <MatrixMath.h>
#include <superSerial.h>

//Global variable
double Rotation[4][4];
float beta;
//LQR controller

void setup(){
Serial.begin(115200);
int m=4;
int n=6;
//coming from MatLab LQR toolbox, precalculated we can even have various K for different type of navigation i.e: with different weight on Q and R//
const float K[4][6]={{0, 0.7071, 0.2236, 0, 0.8468, 0.2493}, //coming from MatLab LQR toolbox//
  {-0.7071, 0, 0.2236, -0.8468, 0, 0.2493},
  {0, -0.7071, 0.2236, 0, -0.8468, 0.2493},
  {0.7071, 0.0000, 0.2236, 0.8468, 0, 0.2493}};
}

void loop(){
  Serial.println("beta,in radians please");
  beta = sSerial.readFloat();
  rotationmatrix(beta);
  Serial.println( Rotation[4][4]);
}

void rotationmatrix(float angle){

double coth,sith;
coth=cos(angle);
sith=sin(angle);
double Rotation={{(pow(coth,2)/2 + coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2)), sith/(2*(pow(coth,2) + pow(sith,2))), (pow(coth,2)/2 - coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2)), -sith/(2*(pow(coth,2) + pow(sith,2)))},
         {-sith/(2*(pow(coth,2) + pow(sith,2))), (pow(coth,2)/2 + coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2)), sith/(2*(pow(coth,2) + pow(sith,2))), (pow(coth,2)/2 - coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2))},
         {(pow(coth,2)/2 - coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2)), -sith/(2*(pow(coth,2) + pow(sith,2))), (pow(coth,2)/2 + coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2)), sith/(2*(pow(coth,2) + pow(sith,2)))},
         {sith/(2*(pow(coth,2) + pow(sith,2))), (pow(coth,2)/2 - coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2)), -sith/(2*(pow(coth,2) + pow(sith,2))), (pow(coth,2)/2 + coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2))}};
 }
  Serial.println( Rotation[4][4]);

What do YOU think this code is doing?

double Rotation={{(pow(coth,2)/2 + coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2)), sith/(2*(pow(coth,2) + pow(sith,2))), (pow(coth,2)/2 - coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2)), -sith/(2*(pow(coth,2) + pow(sith,2)))},
         {-sith/(2*(pow(coth,2) + pow(sith,2))), (pow(coth,2)/2 + coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2)), sith/(2*(pow(coth,2) + pow(sith,2))), (pow(coth,2)/2 - coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2))},
         {(pow(coth,2)/2 - coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2)), -sith/(2*(pow(coth,2) + pow(sith,2))), (pow(coth,2)/2 + coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2)), sith/(2*(pow(coth,2) + pow(sith,2)))},
         {sith/(2*(pow(coth,2) + pow(sith,2))), (pow(coth,2)/2 - coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2)), -sith/(2*(pow(coth,2) + pow(sith,2))), (pow(coth,2)/2 + coth/2 + pow(sith,2)/2)/(pow(coth,2) + pow(sith,2))}};

How about this code? Rotation is a scalar. You can't stuff all those values in a scalar variable.

PaulS:   Serial.println( Rotation[4][4]);

What do YOU think this code is doing?

Printing the (4,4) position of the matrix Rotation actually I only want to check if the calculation performed are right.

You say that is a scalar but I defined Rotation[4][4] on the top. Isn't it enough? I come from MatLab programming so It's very hard for me to deal to all the differencies C-language sees in all this details.

Printing the (4,4) position of the matrix Rotation actually I only want to check if the calculation performed are right.

But, there is no 4,4 position. The indices range from 0 to 3.

You say that is a scalar but I defined Rotation[4][4] on the top. Isn't it enough?

Sure you did. Then, you defined a new variable with the same name and a different type.

You really needs to learn basic C before trying to do whatever it is you are trying to do. For instance, you really need to know when a type is required and when one isn't. You also need to lean when you can initialize arrays all at once, and when you can't.

You need to remove the type ("double") if you just want to use the variable rather than declare it. Also, you can't use the brace syntax (eg myary = {1, 4, 2};) when setting a variable after it's been defined; you have to set each element (like myary[0] = 1; myary[1] = 4; myary[2] = 2;)

WizenedEE: You need to remove the type ("double") if you just want to use the variable rather than declare it. Also, you can't use the brace syntax (eg myary = {1, 4, 2};) when setting a variable after it's been defined; you have to set each element (like myary[0] = 1; myary[1] = 4; myary[2] = 2;)

Thank You so much, that's really helpful. So in C programming actually there's a 0 position. (In matlab doesn't) And even if I define A[4][4], so 4 rows 4 columns, then i call first line 0 and first row 0... mhm. Ok!

Array indices in C start at 0 (always). So a[4][4] has elements a[0…3][0…3]. Just a convention. It works in C.

Loops then t=need to be constructed like for (i=0; i<MAX; i++) → the comparison to MAX has to be < not <=.

As usualy the concepts will be familiar, you just need to get used to the conventions.