全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 MATLAB等数学软件专版
1747 1
2008-10-24

我有以下程序,直接调用下列函数时加粗部分运行不出来,也就是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;
       
        

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2008-10-25 17:26:00

其它结果可不可以运行出来呢?好像end后没加分号,一般函数无法运行好像是不在该工作区,or the length of z1 is zero so no value of y returned?

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群