Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: matrix
Date: Wed, 4 Nov 2009 16:40:18 +0000 (UTC)
Organization: Battelle Energy Alliance (INL)
Lines: 14
Message-ID: <hcsapi$7nt$1@fred.mathworks.com>
References: <hcs07k$kd7$1@fred.mathworks.com> <hcs3tn$fch$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257352818 7933 172.30.248.37 (4 Nov 2009 16:40:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 4 Nov 2009 16:40:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 688530
Xref: news.mathworks.com comp.soft-sys.matlab:582436


One way to do something like this is to mimic manually the integer loop indices.


cnt_ii = 1;
cnt_jj = 1;

for ii = -.5:.1:.5
    for jj = -.9:.1:.9
        G{cnt_ii,cnt_jj} = rand;  
        cnt_jj = cnt_jj + 1;
    end
    cnt_ii = cnt_ii + 1;
    cnt_jj = 1;
end