I continued to work on this last night, and came up with the following
solution which *seems* to work in my test case --- but this may only be
because I've made a mistake somewhere. So: can anyone confirm/deny that
this should do what I think it does? If so, at the cost of a very small
complication in the Gauss code, it would allow the dimensions of a "load"
to be parameterized.
NOBS = 1000;
NVAR = 25;
load XMAT[] = c:\\mydir\\myfile.txt;
XMAT=reshape(XMAT,NOBS,NVAR);
At 10:49 AM 7/11/01 +0100, you wrote:
>The arguments are handled in the parser, which is why they must be constant.
>There is currently no solution other than rewriting the code from:
>
> NOBS = 1000;
> NVAR = 25;
> load XMAT[NOBS,NVAR] = c:\\mydir\\myfile.txt;
>
>to
>
> NOBS = 1000;
> NVAR = 25;
> load XMAT[1000,25] = c:\\mydir\\myfile.txt;
>
>Jurgen.
>
>P.S. As noted in http://www.nuff.ox.ac.uk/users/doornik/ox2do.html
>load without extension on the file expects a .fmt file.
>
>oxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxox
>Dr Jurgen A Doornik
>Nuffield College
>Oxford OX1 1NF, UK
>http://www.nuff.ox.ac.uk/Users/Doornik/
>http://www.oxedit.com
>http://www.pcgive.com
>oxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxox
>
>----- Original Message -----
>From: "Philip A. Viton" <[log in to unmask]>
>To: <[log in to unmask]>
>Sent: Tuesday, July 10, 2001 20:06
>Subject: oxgauss: load
>
>
> > The following GAUSS code doesn't seem to work in OxGauss:
> >
> > NOBS = 1000;
> > NVAR = 25;
> > load XMAT[NOBS,NVAR] = c:\\mydir\\myfile.txt;
> >
> > (The errors are " 'np' undeclared identifier" and " 'np' expression must
> > be constant ").
> >
> > It will work if you provide the explicit numeric dimensions (load
> > XMAT[1000,25] = ...) but this seems undesirable if you intend to use NOBS
> > and NVAR later.
> >
> > Is there a work-around ?
> >
> >
> >
> >
> > ------------------------
> > Philip A. Viton
> > City Planning, Ohio State University
> > 190 W. 17th Ave,Columbus OH 43210
> > [log in to unmask]
> >
> >
------------------------
Philip A. Viton
City Planning, Ohio State University
190 W. 17th Ave,Columbus OH 43210
[log in to unmask]
|