Since you are new, let us show you how Trendy works.

Close-button

Average magnitude of earthquakes past day

This trend is broken.

Error using urlreadwrite (line 98)
Error downloading URL. Your network connection may be down or your proxy settings improperly configured.

Error in urlread (line 36)
[s,status] = urlreadwrite(mfilename,catchErrors,url,varargin{:});

650

data points

Error

Description:

Including all earthquakes in the world. Data provided by the Eearthquake Notification Service ENS.

Recently Collected Data (last 5 of 650) Show All Data

Time Recorded (time1713) Data (data1713)
03 Apr 2015 04:01:14 NaN
02 Apr 2015 04:00:13 [1.68918918918919]
01 Apr 2015 04:00:23 [1.55674157303371]
31 Mar 2015 04:00:13 [1.87860962566845]
30 Mar 2015 04:00:14 [1.69019607843137]
% -------------------------
% import and prepare data

url = 'http://earthquake.usgs.gov/earthquakes/feed/csv/all/day';
block = urlread(url);
fmt = '%s %s %s %s %s %s %s %s %s %s %s %s %s';
readData = textscan(block, fmt, 'delimiter', ',');


% -------------------------
% process
T = size(readData{5},1);
magnitudes = zeros(T-1,1);
for t = 2:T
magnitudes(t-1) = str2double( char( readData{5}(t) ) );
end

magNAN = isnan(magnitudes);
magnitudes_adj = magnitudes(magNAN==0);

avgMagn = mean(magnitudes_adj);

updatetrend(avgMagn);
Tags:

    Add Tags


    0 comments