I am currently using the following code:
predictors = [Hs2 Dp2 Tp2 windvelocity windirection] % 12x5
Y = [LCvelocity] % 12x1
qualstat = {'rsquare'};rsquare05 = regstats([LCvelocity],[predictors],... 'quadratic', qualstat);r2=[rsquare05.rsquare]';r=sqrt(r2)Error using regstats (line 124)The design matrix has more predictor variables than observations.
But the error keeps happening, unless I diminish the predictors matrix to a 12×3 size, in this case my code works. Anyone knows what is the problem?
Best Answer