Fzero Error, Unbalanced or unexpected parenthesis or bracket
이전 댓글 표시
I'm currently trying work with the fzero built in function, but I am constantly being given the error of Unbalanced or unexpected parenthesis or bracket. Below is my code.
fun=@cos;
x0 = [1,2];
x = fzero(fun, x0)
I understand what the error is saying, but I don't see why it's displaying it.
댓글 수: 2
Walter Roberson
2017년 7월 16일
That code works when I copy and paste it.
Perhaps the error is on some earlier line?
Stephen23
2017년 7월 17일
@Zachary Cutter: please edit your question and show us the complete error message. This means all of the red text.
답변 (1개)
Steven Lord
2017년 7월 17일
0 개 추천
Copy all of your code into the MATLAB Editor. In the gutter on the right side of the Editor you should see a red square at the top and a red line somewhere below that. Click on the red line and it should take you to the line of code where MATLAB believes you have an unbalanced or unexpected parenthesis or bracket.
카테고리
도움말 센터 및 File Exchange에서 Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!