Thread Subject: Too many output arguments

Subject: Too many output arguments

From: Assaf Weinstein

Date: 27 Dec, 2009 23:17:04

Message: 1 of 2

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

Subject: Too many output arguments

From: nanren888

Date: 28 Dec, 2009 22:30:22

Message: 2 of 2

"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..

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com