MATLAB Answers

Is there a column limit for data downloaded by FTP?

조회 수: 1(최근 30일)
Ryan Camacho
Ryan Camacho 2021년 5월 13일
댓글: Aditya Patil 2021년 5월 18일
Sorry if the wording was weird, I am working on gathering solar flux data from NOAA via FTP and I can download the information I need, however the file cuts off once the element reaches the 100th character. Is there a way to pull all of the data so that this doesn't happen? Here is my code:
ftpobj = ftp('ftp.ngdc.noaa.gov');
cd(ftpobj,'STP/GEOMAGNETIC_DATA/INDICES/KP_AP');
mget(ftpobj,'2000');
fluxdata = fileread('2000');
The data is supposed to appear like this (without the header or the spaces, those are there to tell you what characters represent which data):
yyyy mm dd nnnn nn nn nn nn nn nn nn nn nn nnn nnn nnn nnn nnn nnn nnn nnn nnn nnn n.n n nnn nnn.n n nnn.n nnn.n nnn.n nnn.n nnn.n
----------------------------------------------------------------------------------------------------------------------------------
2000 01 01 2272 7 53 47 40 33 43 30 43 37 327 56 39 27 18 32 15 32 22 30 1.3 6 48 125.6 0 160.5 175.0 129.9 165.6 179.0
But instead the file that is downloaded shows up like:
0001012272 75347403343304337327 56 39 27 18 32 15 32 22 301.36 48125.60
If I break it out how it's supposed to look you'll see it's missing data:
00 01 01 2272 7 53 47 40 33 43 30 43 37 32 7 56 39 27 18 32 15 32 22 30 1.3 6 48 125.6 0
How do I download this file in a way that lets me keep all of the data?
Thanks!
  댓글 수: 1
Aditya Patil
Aditya Patil 2021년 5월 18일
I downloaded the file using other means than MATLAB, and the data matches what is shown in MATLAB. Can you explain how you got the data with more columns?

댓글을 달려면 로그인하십시오.

답변(0개)

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by