Error message "Invalid use of operator"
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sergio
el 26 de Mzo. de 2024
Comentada: Steven Lord
el 26 de Mzo. de 2024
Hi, when I run "enzymleastsquares.m" I get an odd error
"Invalid use of operator"
I used originally the normal =, but MATLAB asked me to change this to == , then I got this error as stated.
type('enzymeLeastSquares.m')
Where is the error here? All seems fine in the grad_all operator!
Thanks
2 comentarios
Dyuman Joshi
el 26 de Mzo. de 2024
Editada: Dyuman Joshi
el 26 de Mzo. de 2024
How are you calling the function enzymeLeastSquares.m?
What is this line supposed to do?
grad_all((ii-1)*2+[1 2], == -grad;
2nd last line in the same function.
Also, copy and paste your full error message i.e. all of the red text. Whenever you encounter an error, best to provide the full details of it.
Steven Lord
el 26 de Mzo. de 2024
Note that if you edit enzymeLeastSquares.m in the MATLAB editor, you receive two Code Analyzer messages.
One is orange, indicating that the variable grad defined on line 13 is not used. [I know you use it on line 15, but keep reading.]
The second, more serious message, is red indicating a fatal error that will prevent your code from running to completion. That's on line 15, which @Dyuman Joshi already called out in their comment. MATLAB doesn't understand what you're trying to do there. It's not valid MATLAB syntax.
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Multidimensional Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!