[問題] 有關function的問題已回收

看板MATLAB作者 (宅宅)時間15年前 (2010/05/16 23:28), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
請問一下面我po的程式碼 在run的時後一直顯示第九行SMD(:,1)=CavityStrain_Pressure(:,1)./100;有錯誤 可是我卻找不出這個function錯在那 希望有好心人給我解答 感謝 function [SMD] = Shear_Modulus_Degradation (CavityStrain_Pressure,Wc,N) %[SMD]=Shear_Modulus _Degradation (CavityStrain_Pressure, Wc,N) %[SMD]=Interpretation of Secant Shear Modulus Degradation Characteristics from Pressuremeter Tests % SMD:Output,four column matrix:the frist two columns are copy of input,the third one is recovered pressure,and the last one is secant shear modulus % CavityStrain_Pressure _Input,two column matrix with the frist one showing cavity strain in % from low to high (positive) and the second one showing pressure % Wc:Circular cutoff frequency for the low-pass filter % N:Number of data used for Blackman window approximation,should be an even integer SMD(:,1)=CavityStrain_Pressure(:,1)./100; SMD(:,2)=CavityStrain_Pressure(:,2); I=length(CavityStrain_Pressure(:,1)); Slope=(CavityStrain_Pressure (I,2)-CavityStrain_Pressure (1,2))/(I-1); J=linspace (0,I-1,I); P=CavityStrain_Pressure (:,2)-CavityStrain_Pressure (1,2)-Slope*J'; P (I+1:2*I-2)=flipud (-P(2:I-1)); P=reshape (repmat (P,1,round (N/I)),(2*I-2)*round (N/I),1); K=linespace (-N/2,N/2,N+1); ht (1,N/2)=2*sin (Wc*K (1:N/2))/2/pi./K(1:N/2); ht (N/2+1)=2*Wc/2/pi; ht (N/2+2:N+1)=2*sin (Wc*K (N/2+2:N+1))/2/pi./K(N/2+2:N+1); dhdt (1:N/2)=(2*Wc/2/pi.*cos (Wc*K (1:N/2))-ht (1:N/2))./K(1:N/2); dhdt (N/2+1)=0; dhdt (N/2+2:N+1)=(2*Wc/2/pi.*cos (Wc*K (N/2+2:N+1))-ht (N/2+2:N+1))./K(N/2+2:N+1); ht=ht.*(0.42+0.5*cos (2*piK/N)+0.08*cos (4*pi*K/N)); dhdt=dhdt.*(0.42+0.5*cos (2*pi*K/N)+0.08*cos (4*pi*K/N)); for L=1:I SMD (L,3)=fliplr (ht)*P (L+round (N/I)*(I-1)-N/2:L+round (N/I)*(I-1)+N/2); SMD (L,4)=fliplr (dhdt)*P (L+round (N/I)*(I-1)-N/2:L+round (N/I)*(I-1)+N/2); end SMD (:,3)=SND (:,3)+slopeJ'+CavityStrain_Pressure (1,2); Scale_factor=(I-1)/(abs (log10 (SMD (1,1))-log10 (SMD (I,1)))); SMD (:,4)=-0.5*(1-SMD (:,1)).*(slope+SMD (:,4))/log(10)./SMD(:,1)*Scale_factor; SMD (:,1)=SMD (:,1)*100; -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.130.161

05/17 01:22, , 1F
至少把錯誤訊息貼出來?
05/17 01:22, 1F
文章代碼(AID): #1By0ys2Z (MATLAB)