Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!tribune.usask.ca!support1.mathforum.org!not-for-mail
From: sronggot <istardi@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: error in while function
Date: Wed, 27 Feb 2008 01:19:29 EST
Organization: The Math Forum
Lines: 18
Message-ID: <6820854.1204093199469.JavaMail.jakarta@nitrogen.mathforum.org>
NNTP-Posting-Host: nitrogen.mathforum.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: support1.mathforum.org 1204093199 3507 144.118.30.135 (27 Feb 2008 06:19:59 GMT)
X-Complaints-To: news@support1.mathforum.org
NNTP-Posting-Date: Wed, 27 Feb 2008 06:19:59 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:453945


Dear,

I have problem with my matlab programming, i use while for my iteration and after i run my program.. there are message error like this 

'??? Attempted to access U1(:,1); index out of bounds because numel(U1)=1.'

anyone can help me to solve this problem..

this my simple program :

 i=1;
        U1(1)=500;%First guess [W/m2C]
        while abs((U1(i+1)-U1(i))/U1(i+1))>=0.01
A_total=Duty*1000/(U1(i)*delta_T)
i=1+i;
U1(i)=1/A_total;
end
U1final=U1(i)