Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How do I run codes in environments other than MATLAB default folder?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I met the problem when I tried to run the following code written in a script file on my desktop,
[xasterisk,value]=fminsearch(@(x)100*(x(2)-x(1)^2)^2+(1-x(1))^2,[0,0])
then, I get the error "Attempt to execute SCRIPT fminsearch as a function:" then, I copied the code to the command window, and I got the same error. Finally, I decided to change the current folder to MATLAB folder, and the error disappears. So I guess the problem is because some environment setting issues, i.e. I can't visit fminsearch on desktop (Am I right?). So my question is how can I run codes on other folders that I assign (in my case, I usually save files, both scripts and function files on desktop)?
0 comentarios
Respuestas (1)
Walter Roberson
el 7 de Oct. de 2015
Go back to the other location and ask for the output of
which -all fminsearch
and tell us what the result is.
The expected output would be in somewhere under your MATLAB installation directory in toolbox/matlab/optimfun/fminsearch.m
0 comentarios
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!