?? inputfilepreparation.m
字號:
function [TimeNum]=InputFilePreparation(StartTime,TimeStep,EndTime,Longitude,Latitude)
AllTime=StartTime:TimeStep:EndTime;
%%
Fid_Input=fopen('tidepre_time.dat','w');
if Fid_Input<0
error('tidepre_time.dat文件正在使用中,無法進行寫操作!');
end
%%
TimeNum=length(AllTime);
StationNum=length(Longitude);
for c2=1:TimeNum
for c1=1:StationNum
CurrentDateStr=strrep(datestr(AllTime(c2),29),'-',' ');
CurrentHour=hour(AllTime(c2))+minute(AllTime(c2))./60+second(AllTime(c2))./3600;
fprintf(Fid_Input,'%.10f %.10f %s %.4f\n',Longitude(c1),Latitude(c1),CurrentDateStr,CurrentHour);
end
end
fclose(Fid_Input);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -