I tried to run a simple matlab code in java (I'm new to Java).
In matlab, I created this function :
Function [y] = square[x]
y = sqrt(x)
end
I named the class: square
But when I run the function in Eclipse, I couldn't make it work.
Here is the code in Eclipse:
import square.*;
import com.mathworks.*;
import com.mathworks.toolbox.javabuilder.*;
public class square {
/**
* @param args
*/
public static void main(String[] args) {
square x = new square();
Double z = x.square(8);
}
}
The error is: The method square(int) is undefined for the type square
Any idea? Thanks so much!
Square x = new Square(); Double z = x.square(8);? I dont know the matlab stuff but in your classsquaredoes a methodsquarenot exists...