Error when using str2func: "Invalid expression. Check for missing multiplication operator, missing [...]"
이전 댓글 표시
Full error text: "Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error.
To construct matrices, use brackets instead of parentheses."
Short summary: I'm creating a target function I want to use in a fmicon optimization process. The target function is assembled iteratively from a set of 2-D data points. Everything works fine if the number of points is small, but after a certain threshold I get that error message.
I've attached the content of the function I want to transform in a text file (I exported the variable to a .txt file via writematrix). The line of code that gives me the error is:
Newfunc = str2func(tabledata)
What I'd like to know:
1) Is there a way to find at which point of my text file the str2func function crashes? It's too long for a human to just notice a tiny error.
2) Is the function too long for Matlab to handle? As I increase the number of iterations the function becomes longer, and I'm not sure where the limits are.
Thank you!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Argument Definitions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!