MATLAB: Error for mismatched delimiters in relative long equation.

log

I am trying to isolate q in this equation, but I am having trouble defining the equaation:
>> eqn = ((xr(1-q))/k - r(1- (x(1-q))/k)-1)((log(xq+1))-q*q/c) + ((r(1-(x(1-q))/k)+1)(1-q)+(i-0)/x)(x/(xq+1)-2q/c) == 0
eqn = ((xr(1-q))/k - r(1- (x(1-q))/k)-1)((log(xq+1))-q*q/c) + ((r(1-(x(1-q))/k)+1)(1-q)+(i-0)/x)(x/(xq+1)-2q/c) == 0
Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
I checked the parentheses a few times and they seem fine (I think).
Is it maybe related to log()? I tryed ln() aswell and I get the same error.

Best Answer

I guess you are missing a product(*)
eqn = ((xr(1-q))/k - r(1- (x(1-q))/k)-1)*((log(xq+1))-q*q/c) + ((r(1-(x(1-q))/k)+1)*((1-q)+(i-0)/x)*(x/(xq+1)-2*q/c) == 0)
If not, what equation are you trying to write?