Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: matrix
Date: Wed, 4 Nov 2009 09:13:13 -0500
Organization: The MathWorks, Inc.
Lines: 39
Message-ID: <hcs242$kct$1@fred.mathworks.com>
References: <hcs07k$kd7$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1257343938 20893 172.31.44.65 (4 Nov 2009 14:12:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 4 Nov 2009 14:12:18 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:582373



"Handan Yaslan" <hyaslan.nospam@mathworks.com> wrote in message 
news:hcs07k$kd7$1@fred.mathworks.com...
> Hi
> I obtained the matrix A using a lot of calcultation  in the for,
> for i=1:N
>    for j=1:N
>        for k=1:N
>          (I did a lot of calcultation ,so I obtained the matrix A )
>                A
>      end
>   end
> end
>
> Main problem;
> for every each step I want to see A matrix. For example
> i=1 j=1,k=1  what is A?
> i=1,j=1,k=2, A=?
> i=N j=N k=N A=?
>
> I tried B(i,j,k)=A,but matlab gives error....
> How can I seperate A matrix for each step?

The easiest way to do this is probably with a cell array:

C = cell(N,N,N);
% start the FOR loops
    % obtain A
    C{i, j, k} = A;
% end the FOR loops

C{2,3,4} % is A for i = 2, j = 3, k = 4.

-- 
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ