Hi Mbunya.
It is my understanding that you are trying to fit a linear model to the data stored in x with y as the ground truth. However, you are getting NaN as the value of some weights after fittting a linear model. I have analysed your data and I feel the problem seems to be occuring because of the following reason.
Some columns in your data - Sd, AD, La, Lo and Al have the same value at all data samples. There are two problems that will occur because of this while fitting a linear model.
- The matrix used to fit a linear model by will become rank deficient. When we try to fit a linear model with the above mentioned fields, MATLAB will throw a warning that the Regression design matrix is rank deficient.
- Also, the above mentioned fields do not add any value to the model fitting. If some property is same at all data samples, its value has no importance in deciding the output of the model for any sample. It is a constant property.
I retrained the model using your data after removing the above mentioned constant properties as shown below.
x=[Q.Tam,Q.Az,Q.Clp,Q.Dp,Q.DH,Q.DN,Q.EB, Q.Pw ,Q.Prs,Q.WD,Q.WV, Q.ZT];
This time no NaN vaues were observed for any weights or the intercepts in the linear model as shown in the image below. Hope this resolves your problem.
Here are some additional resources to help you with linear regression.