我有以下程序,直接调用下列函数时加粗部分运行不出来,也就是Y1生成不了,但是把下列函数的内容粘贴到命令窗口中就可以运行,请问这是什么原因?怎么解决呢?
function [accprob,laplace,N,sm,svar,s,PP,S,Svar,Y1,f,Y2,g,Y3,h,Y4,l,Y5,o,Y6,p,Y7,q,Y8,r,P]=death1(sm,svar,s,y,b,d,m,laplace0)
k=1; %k=2 before this death step
sm(2,4)=0;sm(2,12)=0;s(2,4)=0;s(2,12)=0;svar(1,8)=sym('[]');
z1=y(:,1);z2=y(:,2);z3=y(:,3);PP='z1=y1z2=y2z3=y3';
S=zeros(0,0);Svar=zeros(0,0);
N=termsplit(sm);
%the parsubsample function
m=length(z1);
%m is the number of elements in z1, z2 and z3
c(1)=0;
%to find the corresponding partion of the tree and the corresponding
%subsamples when svar(1,8)=z1,svar(2,4)=svar(2,,12)=z2,svar(3,2)=svar(3,6)=svar(3,10)=svar(3,14)=z3
%if the root node is the terminal node
P=sym('[]');
f=0;g=0;h=0;l=0;o=0;p=0;q=0;
for t=2:m
f=f+1;
Y1(f,:)=[z1(t),z2(t),z3(t)];
c(t)=1;
end
Y2=zeros(0,3);Y3=zeros(0,3);Y4=zeros(0,3);Y5=zeros(0,3);Y6=zeros(0,3);Y7=zeros(0,3);Y8=zeros(0,3);
%end of parsubsample function
laplace=lap1(Y1,f,y,m,c);
DT=1;
accprob=laplace/laplace0*poisspdf(k,6)/poisspdf(k+1,6)*b(k)/d(k+1)*DT;