|Subject:||Function Call From Inside A Command File|
|Date:||Wed, 9 Oct 2013 15:35:59 +0000|
O learned Denizens,
I’m having a spot of bother.
I have an Octave function file which uses nelder_mead_min to do some stuff and it works just fine…when I run it in Octave “standalone”.
But it fails when I run it from a command (BAT) file.
To define terms:
“Standalone” – by double clicking the Octave 3.6.4_gcc4.6.2 on my Windows 7 64 bit machine. The properties of the icon are: C:\Octave\Octave3.6.4_gcc4.6.2_20130408\Octave3.6.4_gcc4.6.2\bin\octave.exe -i --line-editing
I run the file which contains the nelder_mead_min call and it works just dandy.
“from a command file” – I have the following line:
call C:\Octave\Octave3.6.4_gcc4.6.2_20130408\Octave3.6.4_gcc4.6.2\bin\octave.exe -qf weave_damping.m
All the commands up to nelder_mead_min work fine but then I get :
error: 'nelder_mead_min' undefined near line 79 column 20
error: called from:
error: C:\010-Automated_Weave_Damping_Metric\weave_damping.m at line 79, column 18
If I just run octave on the command line (same command as above with no arguments), I get an octave prompt and when typing “help nelder_mead_min” I can see that:
'nelder_mead_min' is a function from the file C:\Octave\Octave3.6.4_gcc4.6.2_20130408\Octave3.6.4_gcc4.6.2\share\octave\packages\optim-1.2.2\nelder_mead_min.m
I would just use that path directly but because I’m not sure how it would fit into my function call:
[par0, v0, nev] = nelder_mead_min (@(par) DampedOscillationFunction(par,X_This,Y_DASH_This,targetcurve),initial_guesses);
I’m presuming I somehow need to add something to the command file (or perhaps some kind of otaverc file?) to get it to add the path to the function, but I know not what or whether that is the right way of going about things.
Suggestions gratefully received, including RTFM if you can give me a hint where to read.
The information contained in this email communication is confidential information intended only for the use of the addressee. Unauthorized use, disclosure or copying of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately by return email and destroy all copies of this communication, including all attachments.
|[Prev in Thread]||Current Thread||[Next in Thread]|