on my system it works:
$ cd ~/bin/octave
$ ls sqare*
squareAndCubeThisNumber.m
$ cat squareAndCubeThisNumber.m
function [y1,y2]=squareAndCubeThisNumber(x)
y1 = x^2;
y2 = x^3;
endfunction
octave:2> [a,b]=squareAndCubeThisNumber(3)
a = 9
b = 27
Dipl.Ing.(FH) Sepp Käsbauer
HF-Labor R&D QA
Rosenberger Hochfrequenztechnik GmbH & Co. KG
Hauptstrasse 1
D - 83413 Fridolfing
Phone: +49-8684-18163
Fax: +49-8684-18211
mailto:address@hidden
http://www.rosenberger.de
Rosenberger Hochfrequenztechnik GmbH & Co. KG
Registergericht: Amtsgericht Traunstein, HRA 5566
persönlich haftender Gesellschafter:
Rosenberger Hochfrequenztechnik GmbH
Registergericht: Amtsgericht Traunstein, HRB 4405
Geschäftsführer:
Dipl.-Kfm. Hans Rosenberger
Dipl.-Ing. Bernhard Rosenberger
Dipl.-Ing. Peter Rosenberger
Dr.rer.nat. Tosja Zywietz
Disclaimer http://www.rosenberger.de/Disclaimer/disclaimer.html
Von: address@hidden address@hidden" im Auftrag von "James Sherman Jr. address@hidden
Gesendet: Donnerstag, 30. August 2012 15:41
An: adi89
Cc: address@hidden
Betreff: Re: Need Help Loading Functions
On Wed, Aug 29, 2012 at 7:43 PM, adi89
<address@hidden> wrote:
Hi guys,
I just started using Octave recently.
I made a text file with
"function [y1,y2]= squareAndCubeThisNumber(x)
y1= x^2;
y2=x^3;"
And that's it in a txt file saved as "squareAnd CubeThisNumber.m"
I saved it to a folder, which is the directory recognized by Octave when i
type pwd.
C:\Users\etc.
when I try to call upon the function, Octave says it's undefined, yet the
file in in the appropriate folder.
I'm getting frustrated, because I thought Octave recognizes these files in
the corresponding directory. I'm not sure what's wrong.. Would appreciate
some input.
Thanks.
--
View this message in context:
http://octave.1599824.n4.nabble.com/Need-Help-Loading-Functions-tp4643486.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave
That should be how it works. Though I just want to make sure that there is no space in your filename (my guess is that it is you just made a typo when writing the email). Also, just to try and cover all the bases, double (and triple) check that there
is no typos in your spelling of the file or function name. I've done this on too many occasions to count.
Hope this helps,
James Sherman