I am trying to create a simple linear regression model. a.csv contains 8 columns. Var1 month dow Hour is_holiday T load Date. I get an error at X = ones… it says undefined unction times for input arguments of type table.
T = readtable('a.csv') x1 = T(:, 6); x2 = T(:,3); y = T(:,7); X = [ones(size(x1)) x1 x2 x1.*x2]; b = regress(y,X)
Best Answer