Knowing the electricity consumption per day in January of the first and second year, how to predict the electricity consumption per day in January of the third year using matlab. Using least squares

x=1:2;

y=[100 150]; %Electricity consumption data to your

p=polyfit(x,y,1)

p =

50.0000 50.0000

y=50x+50

So for the third year, y=50*3+50=200

The amount of data in this question is too small, it is recommended to add data from previous years