Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Problem with a loop!!!
Date: Wed, 17 Dec 2008 10:31:03 +0000 (UTC)
Organization: ErasmusMC
Lines: 42
Message-ID: <giakd7$rhe$1@fred.mathworks.com>
References: <giaibj$6q$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1229509863 28206 172.30.248.35 (17 Dec 2008 10:31:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 17 Dec 2008 10:31:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1095751
Xref: news.mathworks.com comp.soft-sys.matlab:507474


Well, there are basically 2 options: make a normal matrix with 0's or NaN's, or use the cell functions:

B = zeors(15, 7);
B(:) = NaN;
B(1,1) = [1];
B(1,1:2) = [1 2];
B(1,1:3) = [1 2 3];

-or-

A = cell(15, 1);
A{1} = [1];
A{2} = [1 2];
A{3} = [1 2 3];

Greetz,

"george " <qwerty6542@yahoo.gr> wrote in message <giaibj$6q$1@fred.mathworks.com>...
> Hello,
> ..So,i have a loop,
> and i want to make an array with the same columns,but i want to increased the rows  in every loop.
> for example i have this:
> 
> for k=1:15
>     qw[k][7]=[r_Ti(1,2),r_Te(1,2),r_F(1,2),r_Vt(1,2),r_Vi(1,2),r_Vei(1,2),r_Vee(1,2)];
> end
> 
> 
> 
> is this correct?
> 
> And i want in the end of this loop one array with 15 rows and 7 colums..How can i get this?
> 
> 
> 
> ps"the values of r_Ti(1,2) etc. in every loop are different" 
> 
> 
> Thanks for your attention!!
> 
> 
> I hope that you understand .because i don't now good english...