Please help me to fix the problem mentioned as Error-1 and Error-2. I will be very thankful.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Error -1
Error using ^ (line 51)
Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To
perform elementwise matrix powers, use '.^'.
Error in PE_HT (line 125)
x_rec(i)=c1+c2*x_rec(i-1)+c3*hx+c4*x_rec(i-1)*hx+c5*x_rec(i-1)^2+c6*hx^2+c7*x_rec(i-1)^2*hx^2;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Error -2 [When I replaced ^ with .^ then i get the error given below]
Unable to perform assignment because the left and right sides have a different number of elements.
Error in PE_HT (line 125)
x_rec(i)=c1+c2*x_rec(i-1)+c3*hx+c4*x_rec(i-1)*hx+c5*x_rec(i-1).^2+c6*hx.^2+c7*x_rec(i-1).^2*hx.^2;
Best Answer