Hi there,
struct2local.m is a function that make local variables out of the fields
of a structure. This function creates a problem in some circumstances
(details below) at least with Matlab R2010a.
I had replaced it in a previous commit, but I should have sent a message
to this list rather than relay only on the commit message in GIT.
As illustrated with the 2 functions attached, if one of the fieldname is
also the name of a function present in the path, an 'if' statement calls
the function instead of the local variable.
This is in contradiction with the priorities for searching symbol names
stated by Matlab documentation and it looks like a Matlab bug, maybe it
affects only R2010a, but I didn't get a chance to try with other Matlab
versions.
In any case, we can't use struct2local and it is safer to unroll the
fieldnames by hand. In addition, we may create only the local variables
actually needed by the function rather than all the fields of the structure.
All the best,
Michel
-------- Original Message --------
Subject: Re: commits
Date: Fri, 09 Apr 2010 11:38:51 +0200
From: Sébastien Villemot <sebastien.villemot(a)ens.fr>
To: Marco Ratto <marco.ratto(a)jrc.ec.europa.eu>
CC: Stéphane Adjemian <stephane.adjemian(a)gmail.com>, Michel Juillard
<michel.juillard(a)ens.fr>
References: <4BBDF623.3060701(a)jrc.ec.europa.eu>
Hi Marco,
Le jeudi 08 avril 2010 à 17:28 +0200, Marco Ratto a écrit :
> I did a number of commits related to parallel dynare.
Thanks for that.
I have a problem with your commit 320266412... dated 08 april 2010
17:15:15: it reverts to the use of struct2local(), which was removed by
Michel in his commit 2679e190e8... dated 02 april 2010 21:37:43.
It seems that Michel had problems with struct2local() on MATLAB R2010a,
so he purposedly removed the use of that function.
I guess Michel and you have to find an agreement on what is the best
solution there.
--
Sébastien Villemot