From: Barron on
On Jul 15, 8:58 am, Eli Osherovich <eli.osherov...(a)gmail.com> wrote:
>
> After it x's entries are all set to two, but y = 0 (why?)
>

I just tried to replicate this behavior, but couldn't. As expected, at
exit all members of x=2, but I get (properly) y = 40. I tried running
this repeatedly (since you said it was inconsistent), but I get the
same answer every time. Not sure what else to try. I'm running MATLAB
R2010a and gfortran 4.5.0 on a 64-bit Mac. Sorry this isn't helpful,
but if you think of another way I can help, let me know.

--Barron
From: peruron on
On Jul 15, 10:03 pm, Barron <barron.j.bic...(a)gmail.com> wrote:
> On Jul 15, 8:58 am, Eli Osherovich <eli.osherov...(a)gmail.com> wrote:
>
>
>
> > After it x's entries are all set to two, but y = 0 (why?)
>
> I just tried to replicate this behavior, but couldn't. As expected, at
> exit all members of x=2, but I get (properly) y = 40. I tried running
> this repeatedly (since you said it was inconsistent), but I get the
> same answer every time. Not sure what else to try. I'm running MATLAB
> R2010a and gfortran 4.5.0 on a 64-bit Mac. Sorry this isn't helpful,
> but if you think of another way I can help, let me know.
>
> --Barron

Barron,
this IS very helpful.

The strange behavior I observe on a machine with Matlab 2009b. On
another computer, where Matlab's version is 2010a (like yours) it
works fine.
It seems that the newest version of Matlab does work. Though, I still
cannot explain the error on earlier Matlab versions.

Thank you.
From: Eli Osherovich on
On Jul 15, 10:03 pm, Barron <barron.j.bic...(a)gmail.com> wrote:
> On Jul 15, 8:58 am, Eli Osherovich <eli.osherov...(a)gmail.com> wrote:
>
>
>
> > After it x's entries are all set to two, but y = 0 (why?)
>
> I just tried to replicate this behavior, but couldn't. As expected, at
> exit all members of x=2, but I get (properly) y = 40. I tried running
> this repeatedly (since you said it was inconsistent), but I get the
> same answer every time. Not sure what else to try. I'm running MATLAB
> R2010a and gfortran 4.5.0 on a 64-bit Mac. Sorry this isn't helpful,
> but if you think of another way I can help, let me know.
>
> --Barron

Barron,
I have an older version of Matlab on my computer: its 2009b.
In my office, I have 2010a and indeed, the code works as expected
without any problem.
I tried also a computer in our lab with Matlab 2009a where the code
crashes constantly.

Hope that this is a Matalb problem which (hopefully) was solved in
2010a.

P.S.
Still curious how can it be that the code calls ddot() (I tested it
in a debugger) and the result is zero...