') fprintf(fid,'%s \n',strhtml{1,85}) fclose(fid) % fortono apo to xls oloys toys stathmoys [num_data,text_data,all_data] = xlsread('stations_data.xls'); iend=length(text_data); for i=1:iend station(i).name = all_data{i,2}; station(i).long = all_data{i,5}; station(i).long = station(i).long/10000; station(i).lat = all_data{i,4}; station(i).lat = station(i).lat/10000; station(i).elevation = all_data{i,6}; station(i).seismometer = all_data{i,7}; station(i).datalogger = all_data{i,8}; station(i).ml = 0; end for i = length(strhtmltxt)-1:-1:1 if strcmp(strhtmltxt{1,i}(5:7),'sta') %imgstart = i - (length(strhtmltxt) - i) + 1; imgstart = i+1; break end end %{ vrisko sto autoalert toys stathmoys sobgc = 1; if isempty(firstline) imgstart = 48; else imgstart = firstline; end imgend = length(strhtmltxt)-6; difimg = imgend - imgstart; %elegxo se poia stili exo magnitude gia ta kena pio kato if cmagn==1 cmagnv1=2; cmagnv2=1; elseif cmagn==2 cmagnv1=1; cmagnv2=0; else cmagnv1=0; cmagnv2=inf; end %} geagh = 0; ageaae = (length(strhtmltxt)) - imgstart ; for i = 1 : ageaae seismofrall = regexprep(strhtmltxt{1,imgstart},'[^\w'']',''); seismofrallmag = strfind(seismofrall,'MLv'); if isempty(seismofrallmag) seismofrallmag = strfind(seismofrall,'mB'); if isempty(seismofrallmag) seismofrallmag = strfind(seismofrall,'mb'); end sobj.magn{i} = seismofrall(seismofrallmag+2:seismofrallmag+5); sobj.magn{i} = str2num(sobj.magn{i}); sobj.magn{i} = sobj.magn{i} / 1000 ; else sobj.magn{i} = seismofrall(seismofrallmag+3:seismofrallmag+6); sobj.magn{i} = str2num(sobj.magn{i}); sobj.magn{i} = sobj.magn{i} / 1000 ; end sobj.name{i} = seismofrall(1:3) ; findstation = 'tonpoylo' ; sagha = 1; while strcmp(findstation,'tonpoylo') if sagha==1 dong='1'; elseif sagha==2 sobj.name{i} = seismofrall(1:4) ; else geagh = geagh + 1; break end for ik = 1:length(station) if strcmp(strtrim(sobj.name{1,i}),strtrim(station(1,ik).name)) findstation = 'brika'; station(1,ik).ml = sobj.magn{i}; end end sagha=sagha+1; end imgstart = imgstart + 1; %['Bondi Beach', -33.890542, 151.274856, 4], %fprintf(fid,'%s \n',strhtmltxt{1,i}) end %{ fiaxno poia einai sto xarti kai ta bazo sto telos gia na jump metrao = 0; for i = 1:length(sobj.name) for ii = 1:length(station) if strcmp(strtrim(sobj.name{1,i}),strtrim(station(1,ii).name)) %station(1,ii).ml = 'ayto tha to bro '; metrao = metrao + 1; position_jump_stations.n{metrao} = ii; station(1,ii).ml = sobj.magn{i}; break end end end %} fid = fopen('earthquake_alert_seismic_stations.html','r'); i=1; line = fgetl(fid); str_map{i}=line; while ischar(line) i=i+1; disp(line) line = fgetl(fid); str_map{i}=line; end fclose(fid) tobrike = 'fail'; asf = 1; mputloc = 0; gage=1; supload_str_map{1,143} = ' '; supload_str_map{1,gage} =['[' '''
' 'Epicenter: Here(Edw)!' '
' strhtmltxt{1,11} '
' strhtmltxt{1,12} '
Magnitude: ' strhtmltxt{1,23} '
Depth: ' strhtmltxt{1,15} '
Lat/Long: ' num2str(rlat1) ' / ' num2str(rlon1) '
Built via Matlab
Ted Aspiotis' '
Seismic Stations data ' ''' , ' num2str(rlat) ' , ' num2str(rlon) ',' num2str(mputloc) '],' ];
for i=1:iend
% for ii=1:length(position_jump_stations.n)
if station(1,i).ml~=0
if mputloc == 0
supload_str_map{1,iend} = ['[' '''Station name: ' station(1,i).name ' '' + '' '' + ''
Longitude: ' num2str(station(1,i).long) ' '' + ''
Latitude: ' num2str(station(1,i).lat) ' '' + ''
Elevation: ' num2str(station(1,i).elevation) ' '' + ''
Seismometer: ' station(1,i).seismometer ' '' + ''
Datalogger: ' station(1,i).datalogger ' '' + ''
Magnitude: ' num2str(station(1,i).ml) ''' , ' num2str(station(1,i).lat) ' , ' num2str(station(1,i).long) ',' num2str(i) '],' ];
else
supload_str_map{1,iend-mputloc} = ['[' '''Station name: ' station(1,i).name ' '' + '' '' + ''
Longitude: ' num2str(station(1,i).long) ' '' + ''
Latitude: ' num2str(station(1,i).lat) ' '' + ''
Elevation: ' num2str(station(1,i).elevation) ' '' + ''
Seismometer: ' station(1,i).seismometer ' '' + ''
Datalogger: ' station(1,i).datalogger ' '' + ''
Magnitude: ' num2str(station(1,i).ml) ''' , ' num2str(station(1,i).lat) ' , ' num2str(station(1,i).long) ',' num2str(i) '],' ];
end
mputloc = mputloc +1;
% tobrike = 'true';
% mputloc = mputloc +1;
% end
% end
else
%a = ['''' station(1,i).name ' '' + ''
' num2str(station(1,i).long) ' '' + ''
' num2str(station(1,i).lat) ' '' + ''
' num2str(station(1,i).elevation) ' '' + ''
' station(1,i).seismometer ' '' + ''
' station(1,i).datalogger ' '' + ''
' num2str(station(1,i).ml) ];
%if strcmp(tobrike,'fail')
gage = gage + 1;
supload_str_map{1,gage} = ['[' '''Station name: ' station(1,i).name ' '' + '' '' + ''
Longitude: ' num2str(station(1,i).long) ' '' + ''
Latitude: ' num2str(station(1,i).lat) ' '' + ''
Elevation: ' num2str(station(1,i).elevation) ' '' + ''
Seismometer: ' station(1,i).seismometer ' '' + ''
Datalogger: ' station(1,i).datalogger ' '' + ''
Magnitude: ' num2str(station(1,i).ml) ''' , ' num2str(station(1,i).lat) ' , ' num2str(station(1,i).long) ',' num2str(i) '],' ];
%mputloc = mputloc +1;
%end
%tobrike = 'fail';
end
end
%str_map{1,11} = [str_map{1,11} ' '];
%str.nam2 = ['Ted_Aspiotis___' stri.nam 'greece_seismometers.html'];
fid = fopen(str.nam2,'wt');
for i=1:14
fprintf(fid,'%s \n',str_map{1,i})
end
for i=1:143
fprintf(fid,'%s \n',supload_str_map{1,i})
end
str_map{1,86} = ['$wsite = " Google Maps Earthquake alert // ' strhtmltxt{3} '"; '];
str_map{1,87} = ['$visitlink = "http:///seismic_events_matlab/' stri.nam2 '.html"; '];
for i=16:length(str_map)-3
if i == 39
fprintf(fid,'%s \n', [ 'for (i = 0; i < locations.length-' num2str( mputloc-geagh) '; i++) { ' ]);
elseif i==61
fprintf(fid,'%s \n',[ 'for (i = locations.length-' num2str(mputloc-geagh) '; i < locations.length; i++) { ']);
else
fprintf(fid,'%s \n',str_map{1,i})
end
end
fprintf(fid,'%s \n','
Ted Aspiotis // tedasjob@gmail.com //
') fprintf(fid,'%s \n','') fprintf(fid,'%s \n','