help-octave
[Top][All Lists]
Advanced

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

Creating double hypermatrix in C++


From: Shamika Mohanan
Subject: Creating double hypermatrix in C++
Date: Tue, 18 Oct 2016 15:52:54 +0530

Hello,

I'm trying to create a 3D double matrix using Octave API. This is what I have so far.

NDArray ndarray_double;            
for( a= 1 ;a<=3 ; a++)
{             
  for(b=0;b<iRows;b++)
  {
   for (c=0;c<iCols;c++)
   {
    ndarray_double(b,c,a)=(listItem[b+iRows*c]);
   }                           
  }            
}
dim_vector d = (ndarray_double.dims());
octave_value_list in=octave_value (ndarray_double);

I assigned a 3x3x3 matrix  to ndarray_double. When I printed the value of d, I got 0,0,32.

1. Did I initialize and assign values to a double hypermatrix correctly?
2. Is dims() the correct way to get the dimensions of an NDArray?

Regards,
Shamika

reply via email to

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