Storing products in a folder in my directory

조회 수: 2 (최근 30일)
charles atlas
charles atlas 2015년 3월 16일
댓글: charles atlas 2015년 3월 17일
All,
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.
Code:
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

채택된 답변

Sean de Wolski
Sean de Wolski 2015년 3월 16일
mkdir and fullfile are your friends here.
mkdir('products')
fullfilepath = fullfile(userDir,'products','dfjksdf.txt')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by