[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: equivalent for C-style init: structname varname[] = {...} ?

From: Yury T.
Subject: Re: equivalent for C-style init: structname varname[] = {...} ?
Date: Mon, 12 Nov 2012 09:39:20 -0800 (PST)

Thank you guys, but all this seems to be not I'm looking for.

Indeed, I'm looking for the arrays of structs and also I want to initialise
those with undetermined number of structs-constants. Like I showed in my
example, anyway.

Why do I need this? I have an undetermined number of datafiles which I need
to process (fit with least-squares) using certain parameters specific to
each file. And I'd like to have some annotations to those files, too (paper
from which the data is derived etc.). The processing itself is quite
uncomplicated, so I was figuring on use of something like following
(C-style) right in my .m script:

name[] = {

{ "file1.dat", par1_1, par2_1, "ID1" }, # comment
{ "file2.dat", par1_2, par2_2, "ID2" }, # comment


which I would then expand (or contract) as necessary and just rerun the .m
script. Previously I was doing just that sort of thing in R.

Of course, I might just have to go with a printf-format-style reading of the
text file, but that will at the very least force me to use a separate file.

@Jordi: indeed, I feel that the documentation is somewhat unclear and not
very happily structured w/r to the arrays of all kind. Don't get me wrong,
you guys are doing sterling work, but...

View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]