What is the script run path, this is really important!!
Important 1: The path you saved by default
Important 2: the relative path of your visit
Put the diagram first:
Look at one more picture:
My operation, click on the left side of the folder to make the upper box of the display bar path is not the same, and then click Run, found that the PWD indicates the path is not the same. Of course he died. The default path for scripts is worrying. No wonder I'm always on the wrong path. Addpath always goes wrong.
Workaround:
(1) Follow the above, point to the left of the folder, so that the path shown on the box and your favorite path (you want to run the script path) consistent.
(2) FA 2,run (' Path of your script ')
(3) Attach a method to permanently modify the default path (not recommended)
Http://jingyan.baidu.com/article/495ba841f60b2238b20ede7c.html
Come on, there's a story about spitting blood (matlab) What is the script run path