Results 1 to 2 of 2
  1. #1
    romina is offline Member
    Join Date
    Jul 2007
    Posts
    26
    Rep Power
    0

    Default I need to be able to deal with functions like matlab

    Is there a variable type function in java? I need to be able to deal with functions like matlab does.
    For example:

    Java Code:
    function x = "X^2";
    Then evaluate the function at a point, for example:

    Java Code:
    x(10);
    Is this possible?
    Thanks.

  2. #2
    barney is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default

    What's wrong with doing:

    Java Code:
    public double f(double x) {
    return x*x;
    }
    
    System.out.println(f(10));
    Greetings.

Similar Threads

  1. Functions in jsp
    By samson in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 03-25-2009, 10:04 PM
  2. Help, Integrate a Java with Matlab
    By toby in forum Advanced Java
    Replies: 2
    Last Post: 08-07-2008, 07:08 AM
  3. Calculating trigonometric functions
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-16-2008, 10:56 PM
  4. Calculating hyperbolic functions
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-16-2008, 10:55 PM
  5. Replies: 3
    Last Post: 04-10-2008, 09:01 AM

Posting Permissions

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