how to do sequence for this case (alphabet)

This command just for one file
ftpsite=ftp('website','username','password'); cd(ftpsite, 'ISK1/Hourly/210'); mget(ftpsite, 'isk1210b.zip'); unzip('isk1210b','C:\Multipath3SGU\MultipathMapping3SGU');
How i get more file with sequence command
cd(ftpsite, 'ISK1/Hourly/210');
mget(ftpsite, 'isk1210a.zip');
mget(ftpsite, 'isk1210b.zip');
mget(ftpsite, 'isk1210c.zip');
mget(ftpsite, 'isk1210d.zip');
mget(ftpsite, 'isk1210e.zip');
mget(ftpsite, 'isk1210f.zip');
mget(ftpsite, 'isk1210g.zip');
mget(ftpsite, 'isk1210h.zip');
mget(ftpsite, 'isk1210i.zip');
mget(ftpsite, 'isk1210j.zip');
mget(ftpsite, 'isk1210k.zip');
mget(ftpsite, 'isk1210l.zip');
mget(ftpsite, 'isk1210m.zip');
mget(ftpsite, 'isk1210n.zip');
%NEXT............................................ cd(ftpsite, 'ISK1/Hourly/220');
mget(ftpsite, 'isk1220a.zip');
mget(ftpsite, 'isk1220b.zip');
mget(ftpsite, 'isk1220c.zip');
mget(ftpsite, 'isk1220d.zip');
mget(ftpsite, 'isk1220e.zip');
mget(ftpsite, 'isk1220f.zip');
mget(ftpsite, 'isk1220g.zip');
mget(ftpsite, 'isk1220h.zip');
mget(ftpsite, 'isk1220i.zip');
mget(ftpsite, 'isk1220j.zip');
mget(ftpsite, 'isk1220k.zip');
mget(ftpsite, 'isk1220l.zip');
mget(ftpsite, 'isk1220m.zip');
mget(ftpsite, 'isk1220n.zip');

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2011년 12월 3일

0 개 추천

One way to do it, construct your file names in the for-loops
for k={'1210','1220'}
for j='a':'n'
FileName=strcat('isk',k,j,'.zip')
mget(ftpsite,FileName);
end
end

댓글 수: 2

Matmien
Matmien 2011년 12월 4일
for k={'1210','1220'}
for j='a':'n'
FileName=strcat('isk',k,j,'.zip')
mget(ftpsite,FileName);
end
end
when i try to run.. some error detect..
error('MATLAB:ftp:FileUnavailable','File "%s" not found on server.',name);
Fangjun Jiang
Fangjun Jiang 2011년 12월 4일
You can see that the FileName is certainly correct. Try run the command mget(ftpsite, 'isk1220n.zip') at the command line. It you can get the file, then I would try adding a pause(n) statement after the mget() in the for-loop. n means n seconds which you can try and error to find the best value.

이 질문은 마감되었습니다.

질문:

2011년 12월 3일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by