Info
This question is closed. Reopen it to edit or answer.
How do I run codes in environments other than MATLAB default folder?
1 view (last 30 days)
Show older comments
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 Comments
Answers (1)
Walter Roberson
on 7 Oct 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 Comments
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!