Downloading the oldest available version of some data files
Why don't you read the index from http://www.rbsp-ect.lanl.gov/data_pub/rbspa/MagEphem/def/ and use that to decide which files you want to download?

Also, try to give multiple files (eg. 20) to each curl call: this will enable curl to reuse the same connection for those files.

Please also note that Matlab is not the right tool for this job. For example, this would be easier in Python which has many libraries to perform HTTP requests.