creating folder in matlab

Respuestas (2)

Chunru
Chunru el 14 de Jul. de 2022
% create folder (in current folder)
folder = "mydir";
mkdir(folder);
% save data in a file in the folder
a = rand(3);
save(fullfile(folder, 'test.txt'), 'a', '-ascii');
% show the file
type mydir/test.txt
9.1502065e-01 3.7285299e-01 4.3150896e-01 7.5313780e-01 3.3675547e-01 7.8404462e-01 6.1655730e-01 8.5559888e-01 5.9375337e-01

3 comentarios

PA
PA el 14 de Jul. de 2022
  • thanks for the answer and i was able to create the folder but my test file dont get stored in the folder rather when i run it its out of the folder.
Chunru
Chunru el 15 de Jul. de 2022
Show your code.
KSSV
KSSV el 15 de Jul. de 2022
It saves in the pwd... You give path in the name.

Iniciar sesión para comentar.

Categorías

Preguntada:

PA
el 14 de Jul. de 2022

Comentada:

el 15 de Jul. de 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by