help-octave
[Top][All Lists]
Advanced

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

Oct File Access Array Elements


From: Thomas D. Dean
Subject: Oct File Access Array Elements
Date: Fri, 2 Aug 2019 22:01:24 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

I have an application that calls a C library function to get a list of values. These values are uint8_t. The function call seems to work OK, but, I am having problems getting the data back to octave.

   A = mufunc()

After reading the source code and the docs, I believe

        dim_vector dv(1, 2);
        dv(0) = 1;
        dv(1) = 2048;
        uint8NDArray out(dv);

is the best definition to do this.

The code that reads the device and returns values to octave is:

        OCTAVE_LOCAL_BUFFER (double, dev_dat, 2048)
        rc = read_dev(dev, dev_dat)
        copy data into out  --- how?
        ...
        return octave_value(out);


How do I either use the array out in the call to read_dev or iterate and copy the values from dev_dat into out?

How do I assign values to members of the uint8NDArray out?

Or, better, how do I pass the uint8NDArray into the call to read_dev()?

Tom Dean



reply via email to

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