MATLAB: Error: Unbalanced or unexpected parenthesis or bracket.

error in parentheses

function pi_all=pi_req(I,input_x)
pi_all=zeros(I+1,1);
for i=1:I+1
pi_all(i)=(1-(i-1)/6)*(0.45+1.10*(input_x(i)/2 + sum(input_x(1:i-1)));
end
I have defined input_x & I. but it's still showing the error.

Best Answer

pi_all=zeros(I+1,1);
for i=1:I+1
pi_all(i)=(1-(i-1)/6)*(0.45+1.10*(input_x(i)/2 + sum(input_x(1:i-1))));
end
YOu need to close the bracket.
Related Question