help-octave
[Top][All Lists]
Advanced

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

Re: First attempt to plot


From: Andy Buckle
Subject: Re: First attempt to plot
Date: Tue, 21 Dec 2010 09:30:33 +0000

> I've been trying the following:
>
> s1 = 200;
> s2 = -400:10:400;
> plot (s2, sqrt(s1^2 + s2^2 - s1 * s2));
>
> But there seems to be a problem with the term s2^2.  I get the following
> error messages:
>
> error: for A^b, A must be square
> error: evaluating argument list element number 1

You probably want s2.^2

What you have is trying to do a matrix multiplication s2*s2. I guess
you want an element wise multiplication s2.*s2.

This page
http://math.jacobs-university.de/oliver/teaching/iub/resources/octave/octave-intro/octave-intro.html
explains a bit more.

-- 
/* andy buckle */



reply via email to

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