Why do I receive the error '' Too many input arguments" ?

조회 수: 4 (최근 30일)
Rose Mary
Rose Mary 2023년 2월 10일
답변: Dinesh 2023년 2월 10일
I have the following code for downloading a file.
rm_dir = 'dir1/dir2/dir3/dir4/dir5/dir6';
ftpobj = ftp('host','usename','password');
cd (ftpobj,rm_dir);
mget(ftpobj,'filename.txt','parseOutput',false);
But I get an error message as follows.
Error using matlab.io.FTP/mget
Too many input arguments.
I tried using the fullpath to the file name.But still same error is encountered.
How can I solve this?

답변 (2개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 2월 10일
Have you tried this sytax:
...
mget(ftpobj,'filename.txt', 'myLocalFolder');

Dinesh
Dinesh 2023년 2월 10일
Hi Rose Mary,
This could be due to the following two reasons.
  1. Version compatibility: If you're using an older version of MATLAB, the mget function syntax might have changed. You can check the documentation for the specific version of MATLAB you're using to verify the correct syntax.
  2. File not found: Make sure that the file filename.txt exists in the specified directory dir1/dir2/dir3/dir4/dir5/dir6. If the file is not found, you will receive an error message when trying to download it.

카테고리

Help CenterFile Exchange에서 FTP File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by