octave-maintainers
[Top][All Lists]
Advanced

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

Re: [Solved differently] Re: Hpw to assign a struct to a cell array elem


From: Kozma, Endre
Subject: Re: [Solved differently] Re: Hpw to assign a struct to a cell array element in an .oct file
Date: Sun, 20 Dec 2015 11:32:11 +0100

On Sat, 2015-12-19 at 21:37 +0100, Philip Nienhuis wrote:


So now I have the following code:

:
static const char *fields[] = {"bbox", "data", "min", "max", "ndv"};
octave_map m_band (dim_vector (band_count, 1), string_vector (fields)); 
   /// line wrap
octave_idx_type curr_band;
octave_scalar_map band_struct = (string_vector (fields));
:
for (octave_idx_type curr_band = 0; curr_band < band_count; curr_band++)
  {
   :
   < fill up band_struct with raster data>
   :
   m_band.fast_elem_insert (curr_band, band_struct);
}

Great! Of course octave_idx_type cannot help. I guess, it's only int or long int  depending upon the architecture.
On the other hand, look out, you have defined two curr_band variables. The first one may be superfluous.

Endre
reply via email to

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