0

Hello everyone,

I'm trying to declare a 2-dimension (A[][]) dynamic matrix but I'm having problems ...

The A's elements need to be FLOAT.

The size of lines and columns are both vectorX.size().

Could you help me please?

One of error's message is: "cannot convert `double' to `float**' in initialization"

```
// --------------------------------------
// DYNAMIC DECLARATION OF MATRIX
float **A = 0.0; // pointer for A
A = new float *[vectorX.size()];
for(int i=0;i<vectorX.size();i++)
A[i]= new float [vetorX.size()];
// END DYNAMIC DECLARATION OF MATRIX
// --------------------------------------
for(int i=0; i < vectorX.size();i++)
{
for(int j=0; j<= i;j++)
{
if(vectorY[i] == "NA" and vectorZ[i] == "NA")
{
A[i][i]= 1.53;
}
else if(vectorY[i] == "NA" and vectorZ[i] != "NA")
{
A[i][i]= 1.63;
}
else if(vectorY[i] != "NA" and vectorZ[i] == "NA")
{
A[i][i]= 1.73;
}
else if(vectorY[i] != "NA" and vectorZ[i] != "NA")
{
A[i][i]= 1.73 + 0.5 ;
}
}
}
```