Error for mismatched delimiters in relative long equation.

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.

 Accepted 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?

More Answers (3)

Hi. Can you please help me?
I am using the monte carlo method to integrate the following function f = @((2)*(x)*(e^(-x^2))-(3/x^2+2));
it still says: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters. and I don't know why
solve('sin(y+5)+5*sin(x)+5*cos(5*sqrt(x^2+y^2)+5*cos(x)+5*sin(5*sqrt(x^2+y^2)+5*cos(y)=z',z)))
can anyone suggest what am i doing wrong

1 Comment

check for mismatched delimiters:
this error happens when inside function you do some operations. such as:
assign variable to z=5*sqrt(x^2+y^2) then use z.

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!