From: Ariel Krieger on
Hi there,

I have a function in which I create a bunch of different matrices with different names using evalc and sprintf

mat1
mat2
..
..
..

thing is at some point I need to access a specific index in each and every one of them,
anyone know how to do that?

Thanks
From: John D'Errico on
"Ariel Krieger" <srigi001(a)gmail.com> wrote in message <hklauc$kto$1(a)fred.mathworks.com>...
> Hi there,
>
> I have a function in which I create a bunch of different matrices with different names using evalc and sprintf
>
> mat1
> mat2
> .
> .
> .
>
> thing is at some point I need to access a specific index in each and every one of them,
> anyone know how to do that?
>
> Thanks

The answer is don't do this in the first place.

Use multidimensional arrays, or cell arrays, or structures.

John
From: Ariel Krieger on
"John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <hklbmn$6cm$1(a)fred.mathworks.com>...
> "Ariel Krieger" <srigi001(a)gmail.com> wrote in message <hklauc$kto$1(a)fred.mathworks.com>...
> > Hi there,
> >
> > I have a function in which I create a bunch of different matrices with different names using evalc and sprintf
> >
> > mat1
> > mat2
> > .
> > .
> > .
> >
> > thing is at some point I need to access a specific index in each and every one of them,
> > anyone know how to do that?
> >
> > Thanks
>
> The answer is don't do this in the first place.
>
> Use multidimensional arrays, or cell arrays, or structures.
>
> John

Yea obviously I thought about that, thing is each of these matrices is pretty huge (I'm doing an audio signal processing related project with a very large database) and I can't load more than one of these matrices without risking memory drain, let alone putting all of them into one multidimensional matrix.
From: Bruno Luong on
"Ariel Krieger" <srigi001(a)gmail.com> wrote in message <hkldb7$dkt$1(a)fred.mathworks.com>...
>
I have a function in which I create a bunch of different matrices with different names using evalc and sprintf

And later
>
> Yea obviously I thought about that, thing is each of these matrices is pretty huge (I'm doing an audio signal processing related project with a very large database) and I can't load more than one of these matrices without risking memory drain, let alone putting all of them into one multidimensional matrix.

???
You do not tell us the whole story. Your program create a "bunch of different matrices" or "no more than one of these matrices"?

Do not create dynamic variable name, as John told you.

An alternative is using this:
http://www.mathworks.com/matlabcentral/fileexchange/23078-workspace

Bruno
From: John D'Errico on
"Ariel Krieger" <srigi001(a)gmail.com> wrote in message <hkldb7$dkt$1(a)fred.mathworks.com>...
> "John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <hklbmn$6cm$1(a)fred.mathworks.com>...
> > "Ariel Krieger" <srigi001(a)gmail.com> wrote in message <hklauc$kto$1(a)fred.mathworks.com>...
> > > Hi there,
> > >
> > > I have a function in which I create a bunch of different matrices with different names using evalc and sprintf
> > >
> > > mat1
> > > mat2
> > > .
> > > .
> > > .
> > >
> > > thing is at some point I need to access a specific index in each and every one of them,
> > > anyone know how to do that?
> > >
> > > Thanks
> >
> > The answer is don't do this in the first place.
> >
> > Use multidimensional arrays, or cell arrays, or structures.
> >
> > John
>
> Yea obviously I thought about that, thing is each of these matrices is pretty huge (I'm doing an audio signal processing related project with a very large database) and I can't load more than one of these matrices without risking memory drain, let alone putting all of them into one multidimensional matrix.

If you can't even store them all in memory, then
this is the least of your problems. Regardless,
load each matrix in, in turn. At that point, it
goes into a single variable, always with the same
name. What is the problem here? Yeah, so it takes
time to read them in. This is the price you pay for
making them too large to work with.

Buy a computer with lots of ram and a copy of
64 bit matlab if you insist on working on big
problems. Then use cell arrays. Or, get a cup of
coffee and relax while you read a magazine.

John