octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #36686] Saving and loading function handles th


From: Hartmut
Subject: [Octave-bug-tracker] [bug #36686] Saving and loading function handles that point to subfunctions is not working correctly
Date: Mon, 21 Nov 2016 21:31:17 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0

Follow-up Comment #7, bug #36686 (project octave):

Alright, now I got the point. This behavior IS still present in Octave 4.2.0.

Here is what I did to reproduce it (to maybe make it easier to reproduce for
others):

* create a file "create_func.m" with this content:

function [model] = create_func
 model.odefun = @gas_phase_ODE;
end

function dxdt = gas_phase_ODE(x,t)
  k_ = 0.16;
  v = [-2 1];
  r = k_*x(1)^2;
  dxdt = v'*r;
end


* create a second file "main.m" with this content:

clear all

model = create_func;
model.odefun([2 3],0)

save -binary handle_saved.dat model
clear model

load handle_saved.dat
model.odefun([2 3],0)


Running main.m then gives me this result:

>> main

ans =

  -1.28000
   0.64000

ans =

  scalar structure containing the fields:

    odefun = @gas_phase_ODE



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?36686>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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