Let's play "Count the parentheses". The way to play:
- Start a counter at 0.
- Whenever you see a ( add 1 to the counter.
- Whenever you see a ) subtract 1 from the counter.
If the counter ever goes negative, you have too few left parentheses or too many right parentheses or you have them in the wrong places.
If the counter does not go to 0 at the end of the line, you don't have enough right parentheses.
With Walter's suggestion about adding the right parenthesis for the input argument of the anonymous function, here's what I see when I play:
fun =@(Two) -((Two-Tso)/(1+(Ks/Kw)))-((Ks/Kw)*((Two-Tso)/(1+(Ks/Kw))))*exp((-Ks-Kw)*tsf))-Tsf;
0 1 0 12 1 2 3 210 12 1 23 2 3 4 3210 12 1 0X
X is where the counter would go to -1. Determine which is the correct ) to delete. I would consider defining a different variable, maybe R for ratio, and using it in place of the value Ks/Kw to eliminate a few sets of parentheses.