Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: inv(rand(6,6,2)) question
Date: Mon, 24 Nov 2008 20:37:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 30
Message-ID: <ggf39d$mlm$1@fred.mathworks.com>
References: <ggf2da$898$1@fred.mathworks.com> <ggf2oi$dfo$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 1227559021 23222 172.30.248.37 (24 Nov 2008 20:37:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 24 Nov 2008 20:37:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1376919
Xref: news.mathworks.com comp.soft-sys.matlab:502932


"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <ggf2oi$dfo$1@fred.mathworks.com>...
> "Hydroman S" <amirgsalem@gmail.com> wrote in message <ggf2da$898$1@fred.mathworks.com>...
> 
> > 
> > shouldn't each of the 2 matrcies in  rand(6,6,2) give us a separate inverse? 
> > 
> 
> No.
> 
> Bruno

fine, now if I put it in a loop, I would think that it would work, but it also doesn't:

for i=1:6
x=inv(rand(3,3,i)); 
end

??? Error using ==> inv
Input arguments must be 2-D.



I also applied squeeze, but it does not work as well.  My problem is why? since inside the loop, rand(3,3,1) is gives a square matrix

for i=1:2
x=squeeze(inv(rand(3,3,i))); 
end