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

3 visualizzazioni (ultimi 30 giorni)
Rose Mary
Rose Mary il 10 Feb 2023
Risposto: Dinesh il 10 Feb 2023
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?

Risposte (2)

Sulaymon Eshkabilov
Sulaymon Eshkabilov il 10 Feb 2023
Have you tried this sytax:
...
mget(ftpobj,'filename.txt', 'myLocalFolder');

Dinesh
Dinesh il 10 Feb 2023
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.

Community Treasure Hunt

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

Start Hunting!

Translated by