From: Jan Simon on
Dear us!

> for i=1:nt
> com=sprintf('[a_%d,b_%d]=goo(n);',i,i);
> eval(com);
> end

As far as I understand, Bruno talks of:
for i=1:nt
com=sprintf('[a_%d,b_%d]=goo(n); clear a_%d; ', i, i, i);
eval(com);
end

There should still be a tiny advantage for the [a_i, a_i] approach, because the firstly assigned variable is cleared before the second is created.
Beside this argument, I *like* [dummy, b_i] more, because it tells, what it does and reflects my intentions. So it's more a psychological decision :-)

Jan
From: Bruno Luong on
"us " <us(a)neurol.unizh.ch> wrote in message <hi2uma$77g$1(a)fred.mathworks.com>...

>
> SO - old CSSMers will stick with the
> [foo,foo,foo,goo,goo]=f();
> syntax...
>

Well, new member(s) still not entirely convinced... (see my reply to you us)

Btw, do we consider Jos as considered as junior or senior member? I consider myself and Jan as senior members - well relatively to some other. ;-)

Bruno
From: Bruno Luong on
btw, does the behavior when calling

[foo foo foo] = bar()

is documented? What I mean is: do we have the blessing of Mathworks?

Bruno
From: us on
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hi2v42$535$1(a)fred.mathworks.com>...
> But us, isn't the test unfair when the variable a_i is not properly cleared?
>
> I add the "clear" command and both syntax fails at the same places (see the new foo below).

bruno - well: NO(!, sorry)...
this were just the points - and:
- let's dissect the stuff once more

1) GOO creates A and B at different mem locs (A & B=A+1)...
2) if their size is too big, GOO itself will fail (trivial)...
3) but let's keep in mind: there's a CALLER's workspace (WS) as well: FOO
4) IT (foo) is filled with a lot of different vars [A_x/B_x] created by
GOO (again, not failing by itself in each call)
5) however, FOO (now slowly filling up) is failing earlier if BOTH vars are put into its WS

altogether, the snippet intended to simulate a function's WS which is filled by calls to many (in real life: different) subroutines returning a lot of DUMMY(ie)s...
naturally, the (keen) programmer would have to take care of this by adding a CLEAR DUMMY statement after EACH call (because it's there, in the mem and contaminating any subsequent request in a subfunction!) ... quite tedious and ...unlovely...

here, we deal with massive vol data (coming from fmri studies) - and better believe me, we simply could not work with the [a,b] approach...

just a few more pedestrian thoughts...
us
From: us on
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hi2vf9$r8f$1(a)fred.mathworks.com>...
> "us " <us(a)neurol.unizh.ch> wrote in message <hi2uma$77g$1(a)fred.mathworks.com>...
>
> >
> > SO - old CSSMers will stick with the
> > [foo,foo,foo,goo,goo]=f();
> > syntax...
> >
>
> Well, new member(s) still not entirely convinced... (see my reply to you us)
>
> Btw, do we consider Jos as considered as junior or senior member? I consider myself and Jan as senior members - well relatively to some other. ;-)
>
> Bruno

bruno - wording was OLD, not senior/junior with respect to # of CSSM appearances/ML age... and simply referring to the fact that someone like me (53y) is, well... biologically... very old...

i guess i'm slowly getting to old to hang around in this (lovely) NG any longer...
us