File Exchange

image thumbnail

F10.7 Solar Flux & Ap Indices

version 1.2 (4.65 KB) by

Computes F10.7 solar flux and associated Ap magnetic indices for built-in function 'atmosnrlmsise00'



View License

Appreciable errors in MSIS00 modeled temperatures can occur for altitudes above 75 km if solar flux and magnetic indices deviate significantly from their default values. This routine automatically downloads needed solar flux and magnetic indices from and formats them for input to atmosnrlmsise00.


year = 2010;
doy = 216;
uts = 80000;

[x y z] = f107_aph(year,doy,uts);

alt = linspace(60000,105000,100);
lat = 40;
lon = -105;

[T rho] = atmosnrlmsise00(alt,lat,lon,year,doy,uts,x,y,z);

Comments and Ratings (7)



Hi John,

as Chad pointed out the ftp serve you were using is no longer available. I've found the same informations on still with .obs files.

I have a problem with your code: when I try to run it with a DoY = 1,2 or 3 it gives me this error:

??? Error using ==> ftp.mget at 106
File "/STP/GEOMAGNETIC_DATA/INDICES/KP_AP/1999 2000" not found on server.

Error in ==> f107_aph at 83
mget(f,remote{i}); % download dataset

Can you help me please?

Chad Taylor

Hey John,

I just wanted to make a quick comment about the FTP server you used. The file locations have changed for solar radio flux. They are now currently under the following directory:


The files are also now .txt vs. .obs


shuai (view profile)

Hi. I am using Matlab version R2008a.

John Smith

John Smith (view profile)

Hi Nurul,
I'm afraid I wasn't able to duplicate the error you saw. What version of MATLAB are you running?

Hi. I have a question. I received this error when I run your example:
??? Error: File: f107_aph.m Line: 45 Column: 8
Expression or statement is incorrect--possibly unbalanced (, {, or [.

It is refer to this following command:
[YAp, ~, ~, ~, ~, ~] = datevec(daten-3);

Please advice..Thank you.



Updated the solar flux data ftp address (11/3/2013)

MATLAB Release
MATLAB 7.12 (R2011a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video