Results 1 to 6 of 6

Thread: Koctave with Ubuntu?

  1. #1
    Join Date
    Mar 2007
    Location
    Estonia
    Beans
    99
    Distro
    Kubuntu 10.04 Lucid Lynx

    Koctave with Ubuntu?

    Installed, but when I launch I get:
    "Octave path is not set, but found what seems to be Octave.
    Will try to use usr/bin/octave."
    After clicking OK nothing happens. Even the process in system monitor is killed.

  2. #2
    Join Date
    Mar 2007
    Location
    Estonia
    Beans
    99
    Distro
    Kubuntu 10.04 Lucid Lynx

    Re: Koctave with Ubuntu?

    Apparently I needed kdebase.
    But could somebody help me out with a simple three-dimensional plot? Like z(x,y)=x+y or similar. I've never used such a program before and tutorials I could find sounded too difficult.

  3. #3
    Join Date
    Dec 2005
    Location
    Copenhagen, Denmark
    Beans
    386
    Distro
    Kubuntu 7.04 Feisty Fawn

    Re: Koctave with Ubuntu?

    x= 1:10;
    y= 1:10;
    [X,Y]=meshgrid(x,y)
    Z = X+Y;
    mesh(x,y,Z)
    Troels Kofoed Jacobsen
    Consult the wiki before posting: wiki.ubuntu.com

  4. #4
    Join Date
    Mar 2007
    Location
    Estonia
    Beans
    99
    Distro
    Kubuntu 10.04 Lucid Lynx

    Re: Koctave with Ubuntu?

    Thank you for the reply.

    But how would I enter z^2=x^2+y^2?
    Tried the same way but that gives an error.

  5. #5
    Join Date
    Dec 2005
    Location
    Copenhagen, Denmark
    Beans
    386
    Distro
    Kubuntu 7.04 Feisty Fawn

    Re: Koctave with Ubuntu?

    Quote Originally Posted by merike View Post
    Thank you for the reply.

    But how would I enter z^2=x^2+y^2?
    Tried the same way but that gives an error.
    You cannot do that. This is because octave is like a programming language. It is purely numeric and not algebraic.

    A = B+C evaluates B+C and stores the result in A. if B and C are equally shaped vectors or matrices a will also be a vector or matrix of the same shape. That is what you are using here :
    z=x+y, where x and y are both matrices.

    You cannot have expressions on the left side of the = like
    2*x = a+b <--- invalid.

    So you would have to do:
    x = linspace(-5,5,30);
    y = linspace(-5,5,30);
    [X,Y]=meshgrid(x,y);
    Z1 = sqrt(X.^2 + Y.^2);
    Z2 = -sqrt(X.^2 + Y.^2);
    mesh(x,y,Z1)
    hold on
    mesh(x,y,Z2)
    hold off


    %% Y.^2 means element-wise. Where Y^2 would be Y multiplied with Y (as in matrix multiplication.
    Troels Kofoed Jacobsen
    Consult the wiki before posting: wiki.ubuntu.com

  6. #6
    Join Date
    Mar 2007
    Location
    Estonia
    Beans
    99
    Distro
    Kubuntu 10.04 Lucid Lynx

    Re: Koctave with Ubuntu?

    Thank you

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •