help-octave
[Top][All Lists]
Advanced

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

Passing Large Arrays to Function


From: Thomas D. Dean
Subject: Passing Large Arrays to Function
Date: Mon, 27 Jun 2016 21:42:18 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0

It looks like octave makes a copy of an array when passing it to a function. At least modifying an array within a function does not change the external array unless it is defined as global.

Defining a variable global over several (many?) functions is a shortcut to disaster.

Is there a way to pass an array by reference so modifications within a function change the external array?

Tom Dean



reply via email to

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