[其他] 請問一下如何解決
請問一下板上各位大大
我要跑 31年的水位資料 總共 26萬多筆
利用老師給的hht程式去跑 不過好像發生了記憶體的問題
想問一下板上的大大如何解決 下面是程式碼
http://ppt.cc/p5Zo
錯誤訊息如下
??? Error using ==> horzcat
Out of memory. Type HELP MEMORY for your options.
Error in ==> wavedat2 at 24
Wavedat=[Period Height N];
Error in ==> hht51 at 26
Wavedat2=wavedat2(wheight,s_rate,ndata1);
下面是兩個程式的 code
出問題的地方是在 我寫成wavedat2裡面
hht51
clear all;clc;
w_data=load('height.txt');%height.txt是我的26萬筆的資料文件 一維陣列
%w_data=spi070910(200*25:450*25,1); %name the data file
ndata1=length(w_data); %no. of elements in original time series
s_rate=25;t=[1:ndata1];t=t'/s_rate; % data time (hr) ************
gsta(:,1)=t;
gsta(:,2)=w_data;
figure(1)
plot(gsta(:,1),gsta(:,2));
title('Experimtent ')
xlabel('Time (s)')
ylabel('Height (cm)')
year=gsta(:,1);
inData=gsta(:,2);
rslt=eemd(inData,0,1);
rslt1(:,1)=gsta(:,1);
n=size(rslt);m3=0;
for i=1:n(2)-1
rslt1(:,i+1)=rslt(:,i+1);
end
save hhtcase.dat rslt1 -ascii %save IMF
for i=1:6
depth1(:,1)=rslt(:,i);
wheight=depth1;
stat=std(depth1);
Wavedat2=wavedat2(wheight,s_rate,ndata1);
Period=Wavedat2(:,1);Height=Wavedat2(:,2);
N=Wavedat2(1,3);
Tstat=tstat2(wheight, Period, Height, s_rate, ndata1, N);
Hsig(i)=Tstat(1,5);Tsig(i)=Tstat(1,6);
end
if n(2)<=7
figure (2)
for i1=1:n(2)
i6=i1-1;
subplot(n(2),1,i1)
plot(year,rslt(:,i1))
ylabel(['T',num2str(i6),'=',num2str(Tsig(i1)),'s']);
title(['A',num2str(i6),'=',num2str(Hsig(i1)),'cm']);
end
xlabel('Time (s)');
else
m2=ceil(n(2)/7);
for i2=2:m2+1
figure(i2)
for i3=1:7
i4=m3+i3;
i5=i4-1;
if i4 > n(2)
break
end
subplot(7,1,i3)
plot(year,rslt(:,i4));
if i4<=6
ylabel(['T',num2str(i5),'=',num2str(Tsig(i4)),'s']);
title(['A',num2str(i5),'=',num2str(Hsig(i4)),'cm']);
else
ylabel(['T',num2str(i5)]);
end
axis([0 max(year) min(rslt(:,i4)) max(rslt(:,i4))]);
end
xlabel('Time (s)');
m3=m3+7;
end
end
Hi='finish...tpa.m !!'
----------------------------------------------------------------------
wavedat2的code如下:
% wavdat.m
%calculate the number of waves in the time series, their periods and heights%
function Wavedat=wavedat2(wheight, s_rate, ndata1)
%calculate number of waves in the time series by zero down-crossings%
Nz=0;ndata=ndata1;x=wheight;
for j=1:ndata-2
if (x(j)>0) & (x(j+1)<=0)
Nz=Nz+1; %no. of zero down-crossings
Xlnd(Nz,1)=j; %position in data where zero crossing occurs
end
end
N1=Nz-1; %no. of waves in time series%
%determine the period, crest, trough and height of each wave in the time
series%
Period=(diff(Xlnd))./s_rate; %find the period of waves%
for k= 1:N1 %find height of waves%
wave=x((Xlnd(k)+1 ):Xlnd(k+1));
crest(k,1)=max(wave);
trough(k,1)=abs(min(wave));
Height(k,1)=crest(k,1)+trough(k,1);
end
Nc=length(crest)+length(trough); %no. of optima in time series%
N=zeros(length(Period)); %for display purposes only%
N(1,1)=N1;
Wavedat=[Period Height N];%有問題的地方
想請問一下板上的大大如何解決!!! 感謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.167.163.1