[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Hello World function
From: |
Søren Hauberg |
Subject: |
Re: Hello World function |
Date: |
Tue, 21 Dec 2010 13:08:47 +0100 |
tir, 21 12 2010 kl. 11:49 +0000, skrev Andy Buckle:
> > Hi,
> >
> > I'm trying to get started with functions. I have created Hello.m and
> > added its directory with addpath. Hello.m looks like this:
> >
> > ------------------------------------
> > function Hello
> > printf("\nHej\n\n");
> > end
> > -----------------------------------
> >
> > I call the function by typing "Hello".
> >
> > I get:
> >
> > "error: "Hello" undefined near line..."
> >
> > What is wrong?
>
> That works for me. What is your
> OS,
> version of Octave,
> where did you get Octave from?
>
> Another thought. Is Hello.m in your current directory, or your path?
> - pwd gives working directory
> - ls lists stuff in path
> - path to see directories in your path
> - addpath
Are you using an OS with a case-insensitive file system? Perhaps things
would work for you if you called the function (and file) 'hello' instead
of 'Hello' ?
Søren