immediate refresh function for cd?
1 vue (au cours des 30 derniers jours)
When I run this code in a script:
% what goes here?
the current folder window doesn't update until after the script finishes. Is there a command that could go between the cd and the pause so that the current folder window would show the new folder immediately, without waiting for the script to finish?
Paras Gupta le 7 Sep 2023
I understand that you want to update the current folder window in MATLAB as soon as the cd function is executed in the script above.
Even though the cd function immediately changes the current directory, the current folder window is updated only after the script finishes executing. There is no direct command within MATLAB to achieve this functionality as the current folder window is managed by the operating system's file explorer.
However, you can try a workaround using the winopen function in MATLAB for Windows operating systems. This function opens a specified folder in a new file explorer window. Here's an example of how you can modify your script:
You can also use the system command in MATLAB to execute platform-specific commands for different operating systems. Here's an example that should work across different operating systems:
You can refer to the following documents for more information on the functions above:
Hope it helps.