Assuming that you want to set the parent folder of the current folder as a subfolder, you can use the fileparts
function to get the parent folder and then change the current folder to the subfolder.
Here's an example code:
main.m325 chars14 lines
In this example, we use the fileparts
function to get the path to the parent folder of the current folder. Then, we define the name of the subfolder that we want to create. Next, we check if the subfolder already exists, and if not, we create it using the mkdir
function. Finally, we change the current folder to the subfolder using the cd
function.
gistlibby LogSnag