I now create a plot and save it as the "*.png" in folder "Dataset_ONE". Furthermure I copy "Dataset_ONE.csv"-file into the same folder. If there is a better practise for that, please let me know. I copy the mlx_file and now I want to make sure that I don't use the csv-files from yesterday (because the current folder from yesterday is shown in the file browser of MATLAB) -> so I would like to change the "current folder" automatically with just copying the mlx-file into a new folder. And for example by tomorrow I have new folder. Why: In the same folder with the mlx-file I have for example. My first goal is that I would like to change the "current folder" (-> "cd") to the path of the running script. %example4: same output as example1, because mfilename returns "MatlabEvaluationHelper" Outputs of the examples above executed in a *.mlx-file: %example1: mfilename returns the path to the 'MatlabEvaluationHelper' in the 'AppData\Local\Temp'-folder And I prefere to use *.mlx-files instead of *.m-files.) With *.mlx-files it is not possible anymore. With *.m-files this is possible with the examples above. ( Edit III: Problem: I am not able to get the path/filelocation or name of the current opened/executed MATLAB-file. %For example I would like to do something like this And with that those solutions are not working anymore. m-files I found the following solutions: %example 1īut with MATLAB 2016a there comes a new feature called live script. I'm working on my MATLAB code in a number of different locations, and it would be really helpful if I could make the code aware of its location on the computer.
0 Comments
Leave a Reply. |