octave-maintainers
[Top][All Lists]
Advanced

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

Re: reconstructing m files from octave_function


From: Matt Flax
Subject: Re: reconstructing m files from octave_function
Date: Mon, 10 Dec 2012 21:08:40 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

Yes, the XY problem, allow me  to be more specific.

I am writing code in C++.

I have an m file which is a function and I want to change variable settings in the function and write it back to an m file.

For example  I want to parse y.m (below) using the inbuilt octave C++ parser and
I want to set         z.
and save the file back in the same form, possibly with a different name.

======= begin y.m ============

function x=y

z.>
for i=1:z.one
    x= someOtherFunction(i); % do something
end
end

========= end y.m ============

thanks again
Matt

On 10/12/12 20:24, Júlio Hoffimann wrote:
2012/12/10 Matt Flax <address@hidden>
Hi there,

Has anyone got any idea on how to reconstruct an m file from an octave_function ?

The function
octave_function *load_fcn_from_file (...);

will parse and load an m file, I would like to do this, alter a few variables on the fly and then write back to a different file name ...

Any leads would be appreciated.

thanks
Matt

Hi Matt,

I would suggest you to take a look into `autoload' and `eval' functions, but i prefer you to explain what problem you're trying to solve. Have you heard of the XY problem? http://www.perlmonks.org/index.pl?node_id=542341

Regards,
Júlio.


reply via email to

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