help-octave
[Top][All Lists]
Advanced

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

Re: HELP FOR A FUNCTION


From: c.
Subject: Re: HELP FOR A FUNCTION
Date: Mon, 12 Dec 2011 16:37:09 +0100

On 12 Dec 2011, at 09:56, CARMEN SANCHEZ wrote:
> Good morning:
> I want to built and calculate the integrate of this function y=x*sin(x) with 
> the command quadv, but always I have the same type of error:
<...>

your error has nothing to do with computing the integral, but it's due to the 
attempt tu plot your function

> plot(x,y,'r*')

you never defined a vector named 'y' in the outmost scope so you get the error:

> error: `y' undefined near line 8 column 8

you can fix that by defining y before plotting:

y = f(x);
plot(x,y,'r*')

or even just do

plot(x,f(x),'r*')

this is some really basic octave syntax, which is very well documented in the 
Octave manual:
http://www.gnu.org/software/octave/doc/interpreter/

c.

reply via email to

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