Error when using str2func: "Invalid expression. Check for missing multiplication operator, missing [...]"
Mostrar comentarios más antiguos
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!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Argument Definitions en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!