help-octave
[Top][All Lists]
Advanced

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

Re: Noob Question


From: John Swensen
Subject: Re: Noob Question
Date: Fri, 15 Oct 2010 16:31:29 -0400

On Oct 15, 2010, at 3:57 PM, Matt Curcio wrote:

> Hi All,
> I have just recently installed Octave on Ubuntu 10.4.
> I was looking through the manuals and was trying to do something
> 'easy'  (haha nothing is ever easy!) to start off, just a contour
> plot.
> I tried to follow a close example but got the inevitable error message:
> My little program looks like:
> #Surface contour plot:
> 
> x = 0:0.1:3;
> y = 0:0.1:2;
> [X,Y] = meshgrid(x, y);
> 6-Z=(2*x)+(3*y);
> surf(X,Y,Z)
> 
> but I get the message:
>> error: operator +: nonconformant arguments (op1 is 1x16, op2 is 1x11)
> 
> I looked around the web but didn't find exactly what I wanted.  I
> guess what I am asking for (among other things)
> 1) Where is the best place / forum / web address, etc to look for
> answers to my future questions/problems?
> 2) Is there a good guide or set of tutorials that people like?
> 3) finally any help on this little first attempt of mine??
> Cheers,
> M
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave


For this example, try

x = 0:0.1:3;
y = 0:0.1:2;
[X,Y] = meshgrid(x, y);
Z1=(2*x)+(3*y);
Z2 = 6 - Z1;

then do either
surf(X,Y,6-Z1)
or
surf(X,Y,Z2);

Having 6-Z on the left hand side of an equal sign is an error because the equal 
sign implies you are assigning a value to a variable and (6-Z) is not a 
variable.

As to your other questions, for simple tutorials you can search for either 
Matlab or Octave tutorials and the syntax is the same and most of the core 
functions provided by Matlab are alos provided by Octave.

John Swensen


reply via email to

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