octave-daemon icon indicating copy to clipboard operation
octave-daemon copied to clipboard

Octave structures

Open tims-corbett opened this issue 8 years ago • 2 comments

Hi Gutza,

Is there an example around handling structures returned from Octave?

for example,

function x = fn() x.a = 1; x.b = [1, 2; 3, 4]; x.c = "string"; endfunction

thanks

tims-corbett avatar Jul 12 '16 20:07 tims-corbett

http://projects.moongate.ro/octave-daemon/octave-daemon/tutorial_quickstart.pkg.html#quickstart.qs_other

Gutza avatar Jul 12 '16 22:07 Gutza

the following does two round trips to get an array value. am still struggling to understand how getMatrix() works. It just returned a string to me.

the result below is an array that returns (just an example) inputs and outputs [22, 33, 55]

self::$octave->run("result=sum_numbers(22,33)");
    $i = self::$octave->query("result{1,3}");

is there a more efficient way to do the same using getMatrix?

tims-corbett avatar Jul 13 '16 17:07 tims-corbett