|
"Assaf Weinstein" <assafweinstein_remove.this@gmail.com> wrote in message <hh8ptg$gmq$1@fred.mathworks.com>...
> Hi,
>
> I am running an "if" loop (i=1:size(x,2)), and keep on getting a "Too many output arguments" error, but it seems to be at random indexes: when I run it all over again, I get the same message, but the break occurs at a different index (value of i)..
>
> THERE IS A PART OF THE CODE:
>
> for i=1:size(x,2)
> if x(i)>c
> if x(i)<c_bar_zero_r
> lower(i)=fzero(@(t) 1-normcdf(x(i)-t)+normcdf(x(i)-2*c-r*slength(t,c)-t)-alpha*(1-normcdf(c-t)+1-normcdf(c+t)),[-mu1_tilda,0]);
> upper(i)=fzero(@(t) normcdf(x(i)+r*slength(t,c)-t)-normcdf(x(i)-t)-(1-alpha)*(1-normcdf(c-t)+1-normcdf(c+t)),x(i));
> elseif c_bar_zero_r<x(i) && x(i)<c_hat_halfalpha
> lower(i)=0;%included
> upper(i)=fzero(@(t) normcdf(x(i)+r*slength(t,c)-t)-normcdf(x(i)-t)-(1-alpha)*(1-normcdf(c-t)+1-normcdf(c+t)),x(i));
> elseif c_hat_halfalpha<x(i) && x(i)<c_tilda_zero_r
> lower(i)=0;%not included
> upper(i)=fzero(@(t) normcdf(x(i)+r*slength(t,c)-t)-normcdf(x(i)-t)-(1-alpha)*(1-normcdf(c-t)+1-normcdf(c+t)),x(i));
> elseif c_tilda_zero_r<x(i) && x(i)<c+r*slength(mu1_tilda,c)%marker
> lower(i)=fzero(@(t) 1-normcdf(x(i)-t)+1-normcdf(t-x(i)+2*c+r*slength(t,c))-alpha*(1-normcdf(c-t)+1-normcdf(c+t)),[0, mu1_tilda]);
> upper(i)=fzero(@(t) normcdf(x(i)+r*slength(t,c)-t)-normcdf(x(i)-t)-(1-alpha)*(1-normcdf(c-t)+1-normcdf(c+t)),x(i));
> else
> b=fminbnd(@(t) -(normcdf(x(i)-t)-normcdf(x(i)-r*slength(t,c)-t)-(1-alpha)*(1-normcdf(c-t)+1-normcdf(c+t))),mu1_tilda,x(i));%i'm essentiallx(i) trx(i)ing to obtaing the smaller root..An alternative wax(i) was to trx(i) and find the first crossing of zero..
> lower(i)=fzero(@(t) normcdf(x(i)-t)-normcdf(x(i)-r*slength(t,c)-t)-(1-alpha)*(1-normcdf(c-t)+1-normcdf(c+t)),b-.1);
> upper(i)=fzero(@(t) normcdf(x(i)+r*slength(t,c)-t)-normcdf(x(i)-t)-(1-alpha)*(1-normcdf(c-t)+1-normcdf(c+t)),x(i));
> end
> else
>
>
> I'm desperate.. and stuck about it for a long time now. What can be the problem??
>
> Thans so much,
>
> Assaf
Ok, weird post. Every "y" seems replaced by "x(i)".
An alternative wax(i) was to trx(i) and find the first crossing of zero..
|