Storing products in a folder in my directory

5 views (last 30 days)
So I have a script that reads data with urlread and then stores the data in a .txt file. I store the working directory I am in in a variable called "filePath" and then when I create the text file, I store that text file in my directory.
userDir = pwd;
filePath = [userDir,'\station_data_',datestr(now,30),'.txt'];
fid = fopen(filePath,'w');
This is similar to a question that somebody helped me out with last week. But what I want to do is store the text file in a folder that I create on my directory. I will call this folder "products"
Any help is much appreciated.
- Charles

Accepted Answer

Sean de Wolski
Sean de Wolski on 16 Mar 2015
mkdir and fullfile are your friends here.
fullfilepath = fullfile(userDir,'products','dfjksdf.txt')

More Answers (0)


Find more on Search Path in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by