f



matlab in JAVA or java in MATLAB?

Hi guys

I am now experencing a great difficulty in the interation between java and matlab.

I have an objective function written in JAVA with has method return an numerical number, i call it 'profit'. The nature of this obtive function (ObjFun.java) is that it takes an parameter input, say C, with different C value, the returned profit value is different.

Eventually I want to find the optimized C value which produce the maximun profit (C will be under constrains). Initially I want to use linprog or fminsearch in matlab. So I tried the command in matlab that excutes my ObjFun.java. But it failed because my ObjFun.java will call an external .exe file. and the file path contains spaces which is fine by Java but not matlab. 

I stuck here, I myself is a Java programmer not good at matlab, I can't find any thing on google about the solution to my problem. So here I propose another idea: call matlab function in JAVA. 

I need some advise on this. Thank you very much for a reply!!!

Lemon
0
Lemon
8/3/2010 1:05:32 PM
comp.soft-sys.matlab 211266 articles. 24 followers. lunamoonmoon (257) is leader. Post Follow

2 Replies
1774 Views

Similar Articles

[PageSpeed] 11

can anyone give advice??
0
Lemon
8/4/2010 9:05:11 AM
"Lemon F" <f.lemon.jin@hotmail.com> wrote in message <i3bag7$i96$1@fred.mathworks.com>...
> can anyone give advice??


If you would not have double-posted you would have seen that you already received advice (on the other post): http://www.mathworks.com/matlabcentral/newsreader/view_thread/288403
0
Yair
8/4/2010 1:23:04 PM
Reply:

Similar Artilces:

matlab in JAVA or java in MATLAB? #2
Hi guys I am now experencing a great difficulty in the interation between java and matlab. I have an objective function written in JAVA with has method return an numerical number, i call it 'profit'. The nature of this obtive function (ObjFun.java) is that it takes an parameter input, say C, with different C value, the returned profit value is different. Eventually I want to find the optimized C value which produce the maximun profit (C will be under constrains). Initially I want to use linprog or fminsearch in matlab. So I tried the command in matlab that excutes my ObjFun.ja...

Get a result from Matlab to Java (Call Matlab from JAVA
Hi all, I am having trouble getting the return value from matlab to JAVA. I have tried Kamin Whitehouse 's code(matlabcontrol.java) and get working for eval and feval, but having trouble using blockingFeval function which returnts the value of matlab. The problem I am having is it returns some value valid only in matlab workspace and when I play around with the return value in matlab, it works fine but in Java program it is just junk data. I corresponded with Kamin and he thinks that jmi.jar has been changed since he developed the class. The matlab library now returns the handle of t...

How to notify Matlab about Java object change in Matlab Java Interface?
Hello, Does anybody has any idea how to update Matlab function about Java object change ? It could be done by polling: while JavaObj.getValue()=='not done yet' pause(1); end But polling is evil. There should be more elegant way to do this job ... I've checked 'Matlab Java Interface' docs : http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f6671.html , but found nothing on the subject :( Thanks in advance for your help, Could you use javacomponent to set up the object, and set a callback to repond to the changed value? On Apr 21, 5:44=A0pm, &...

Calling matlab from java (windows), and running the java code not using the matlab JVM
Hello, I want to know if there is a way to call matlab from java (in windows), but not by calling the java code from matlab. I want to use a different JVM than the one matlab uses. In linux it is simple since I can use input/output redirection, is there a way to do this in windows (I have matlab 5.3, pretty old version). Thanks a lot, Nili. ...

Java Jar Files and Matlab need to call my SAX parser from java in matlab
All, I have a java SAX parser that I want to call from matlab. I did the research and figured out how to load the jar containing the class in matlab. Problem is I called my file and apparrently the matlab version doesn't support the SAX parser and/or the JDBC drivers I use to interact with a database. Is there another way to do this other than loading the class into matlab which obviously failed. Would I be able to call the jar somehow with a system command? Thanx Ryan ...

Eclipse RCP and MATLAB (calling MATLAB from JAVA)
Dear all I need some help about using Eclipse RCP with MATLAB. I want receive input variables from web (probably using Eclipse RCP, I just heard about Eclipse RCP) and calcuate something and generate figure or animation in MATLAB. Finally, send the result to the web and display them using Eclipse RCP. I know about MATLAB Web Server (MWS). However, MWS has some limitation, so I want to combine Eclipse RCP with MATLAB for more compatibility. Could you help me ? The example will be greate help for me. Thanks in advance. ...

Call a Matlab function from Java running in matlab.
Hi guys. I really apologize for asking this question, since I'm sure it is either basic or not possible, but I have been reading through the documentation and can't seem to figure this out, since the examples look like they just send and receive variables from the Java methods. Could anyone give me a short example of how to call a method from a Java object that causes some sort of action to be performed in MATLAB? For example, I would like to: 1) make a new object of MyClass from MATLAB called MyObject. 2) run MyObject.DoSomethingInMatlab() 3) have a statement in DoSomethingInMatlab...

Matlab 7: how to remove java object in Matlab?
Hi, I found that there are some GUI windows in Matlab 7 return Java objects directly instead of returnning figure handles or object handles. I want to delete them, but I tried "delete(handles.objJava)" where objJava is some Java object returned by these Matlab GUI windows..., I saved it to handles as a field... but it did not work. The error message is: ------------------------------------------ ??? Invalid handle object. Error in ==> ieMyProgram>myCallbackFcn at 162 delete(handles.objJava); ...

Calling matlab from java
Hello All I am trying to call Matlab from java. I am using Brad Phelan's matlab snippet http://xtargets.com/snippets/user/bradphelan/tag/feval to investigate how to do this but all I get is matlab showing "Busy" and basically hanging. I have tried commenting out the semaphore control which "helps" but I then get a null exception because the return value is null. I call my test routine from matlab as follows: TestMat.main({}) My test routine looks like Brad's example: public class TestMat { public static void main(String[] args) { MatlabFunction&l...

Matlab builder JA: parse java string to matlab cell
Hi all, I'm building a java swing based GUI for my Matlab application. As such, user input is available as text strings, for example "{[0; 0], [3.5 0; 0 2]}" (mean vector and covariance matrix of a 2D Gaussian). The user input will be passed to the compiled matlab method as a MWCellArray. Problem is how do a convert (parse) the above string into a MWCellArray? From its javadoc http://www.mathworks.com/access/helpdesk/help/toolbox/javabuilder/MWArrayAPI/index.html the following method is available: java.lang.String toString() Returns a string representation of this array, ...

call matlab from java with MatlabControl.java
If you are trying to call matlab from java, you can use the jmi.jar files that come with matlab. The interface is not obvious, especially because matlab is inherently single threaded and so if you try calling a matlab function from a java function that was called from another matlab function, it will hang forever. You can try using this class that I wrote, which will let you call eval and feval from java functions that are NOT called from matlab functions. you can also use blockingFeval to call matlab functions from java funtions that ARE called from matlab functions (this is ...

Java program using Matlab JA Builder can not find matlab libraries
Hi all: We are trying to run a java program calling Matlab. When we run our program, we get the following error: Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to find the library libmwmclmcrrt.7.10.dylib, required by MATLAB Builder JA, on java.library.path Therefore we proceed and add the following VM argument: -Djava.library.path=/Applications/MATLAB_R2009a.app/bin/maci/ Now we get a different error: Exception in thread "main" java.lang.LinkageError: dlopen (/Applications/MATLAB_R2009a.app/bin/maci/libnativemcl.jnilib, 9): Library not loaded: libt...

Attaching Java debugger to Matlab? How to debug Java?
Hi everyone, is there any way to debug a Java application that uses Matlab? I remember a while ago I was able to attach VisualCafe 3.1 (or something like that) to Matlab's VM and debug my Java code. I have not been successful in doing something similar with any other Java IDE or debugger recently, or figuring out the alternative. Does anybody know a way to debug Java code that runs within Matlab using a decent IDE? I am using Sun ONE Studio 4 at the moment. Thanks in advance. Nik -- ======================================= Nikita A. Visnevski Adaptive Systems Laboratory CRL,...

java and matlab
I'm trying to build a gui with java swing and add a menu there: import javax.swing.* theTestWindow = JFrame('My Tool'); theTestWindow.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); theTestWindow.setSize(300, 200); theTestWindow.setVisible(1); theMenuBar = JMenuBar(); theTestWindow.setJMenuBar(theMenuBar); theTestMenu = JMenu('File'); theMenuBar.add(theTestMenu); theNewTestMenuItem = JMenuItem('New'); theTestMenu.add(theNewTestMenuItem); that's OK so far, but to add some functionality to the menu, I need to add an ActionListener to the JMenuIt...

java + matlab
Hi guys, As the program I am writing grows, I am considering mixing Java and Matlab. Here is my question: If I write Java classes and methods to manage my data and display it to the user, can I use Java methods to pass data to MATLAB functions and then receive the data back to my Java objects? For example, could I use a Java to allow my User to load some data, then send the data through MATLAB's fft function, and then get the frequency data back for use later in my Java program? It seems as though I could use some of the features that languages like Java and C# provide, but that I stil...

JAVA in MATLAB
Hi! This might not be a MATLAB problem, but anyway, I dont know a better forum to post my question... It's a simple problem: I would like to print my table (class javax.awt.swing.JTable) I created by calling JAVA in MATLAB. (Preferably to a *.ps format so I can print it from unix.) I'm a beginner in JAVA, so I am really lost in the reference guide. There seem to be many ways to print something in JAVA but I cant put my finger on any certain way. What I would like to know is what direction I should look. Anything would be helpful, just to get me started... regards /Per later that ...

Run Matlab ... from Matlab
Hello, Is there any limitation to run Matlab from Matlab, as a system command, on Linux platforms ? I tried to start Matlab, both using the ! syntax (!matlab&) or the system command (system('matlab&')), the Matlab splash screen appears, but the new Matlab session closes rapidly . When I do the same with a script of mine (system('matlab -r "myscript"&')), my script is being executed, but Matlab finally crashes . If I remove the &, it works well, but the first Matlab session is blocked till I close the second one . I run Matlab on a Linux 64bits pla...

Matlab
Hi ! Small entering guide: I need a JAVA GUI for already existing MATLAB programs. Mathworks Link: <http://www.mathworks.com/company/newsletters/news_notes/win02/patterns.html> ode example [JAVA]: // -> IMPORT MATLAB ENVIRONMENT import com.mathworks.*; import com.mathworks.jmi.Matlab; import com.mathworks.jmi.MatlabException; public class matlab extends JFrame { // MATLAB INSTANCE private Matlab matlab; public matlab() { .... .... .... // CREATE MATLAB INSTANCE try { matlab = ne...

Java to Matlab
How does one use Java classes that are added to the classpath ? Barney: > How does one use Java classes that are added to the classpath ? there's copious information at this great site: <http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/ch05matf.html#matlab_interface_to_java> us ...

matlab in java
how do i integrate matlab code into java ...

Java-Matlab
Please convert the below JAVA code to Matlab, thanks. class HelloWorld { public static void main(String args[]) { System.out.println("Hello world!"); } } Huh? How about ============= disp('Hello World!'); ================= Or even just ============= 'Hello World'. =============== Or, if you want to really go wild, try this function file ======================== function HelloWorld java.lang.System.out.println('Hello World') =================== So just what are you asking here? JP wrote: > Please convert the below JAVA code to Matl...

matlab and java
dears i'm a university student and i have a project i want to mix to wav files but the peroblem is: i need to make a jar file to use it on a sun server so is there are some method" """" i want to mix the to wav sound using matlab scripts and i want to call it form java in the last think i want t build a jar file use the matlab scrip without installing matlab "i can install some features needed for this project """""" sorry for may English best regards "mohamad " <lamaa39@hotmail.com> wrote in message ...

Matlab to java
hi all; Please i want to convert .m file ti .jar file and enter it to java netbeans . If any one can do this or know the method ;please till me quickly. Thanks in advance, "sedky" <sedky.cs@gmail.com> wrote in message news:3716cb21-8bc4-4665-9867-0e63298b0cd7@v38g2000yqb.googlegroups.com... > hi all; > > Please i want to convert .m file ti .jar file and enter it to java > netbeans . > > If any one can do this or know the method ;please till me quickly. http://www.mathworks.com/products/javabuilder/ -- Steve Lord slord@mathworks.com ...

MATLAB talking to MATLAB?
For my project, I need to have a client program (MATLAB executable) talking to a server program (also MATLAB executable) to query data. Is there any easy way to accomplish that? I appreciate any help that I can get on that. Thanks. Cheers, Hoi Oops, I forgot to mention. There are multiple clients querying the server, so I guess serial objects + remote serial port wouldn't work. "Hoi Wong" <wonghoi.ee@gmail.com_> wrote in message news:f3ald6$gg4$1@news.Stanford.EDU... > For my project, I need to have a client program (MATLAB executable) > talking to a ser...

Web resources about - matlab in JAVA or java in MATLAB? - comp.soft-sys.matlab

Undocumented Matlab
Undocumented, unsupported and hidden features in Matlab

Matlab Upazila - Wikipedia, the free encyclopedia
... 23°21′N 90°42.5′E  /  23.35°N 90.7083°E  / 23.35; 90.7083 Coordinates : 23°21′N 90°42.5′E  /  23.35°N 90.7083°E  / 23.35; 90.7083 Matlab ...

Open Directory - Science: Math: Software: MATLAB
The MathWorks - Developers of MATLAB, Simulink and Stateflow. Offers products for data analysis, visualization, application development, simulation, ...

MATLAB Mobile on the App Store
Read reviews, compare customer ratings, see screenshots, and learn more about MATLAB Mobile. Download MATLAB Mobile and enjoy it on your iPhone, ...

The Smart Emergency Response System Using MATLAB and Simulink - YouTube
In the aftermath of an earthquake, every second counts for disaster victims. Imagine a system that can locate people quickly and help first responders ...

The A-Z of Programming Languages: MATLAB
What prompted the development of MATLAB?

Matlab: Invalid .NET Framework. Either the specified framework was not found or is not currently supported ...
If you are trying to compile Matlab into .Net framework, you might encounter this message, even though you have the .Net framework installed ...

Matlab edges closer to electronic design automation world
Matlab, one of the world's most widely used products for algorithmic development, has long occupied its own niche far removed from EDA and hardware ...

Can I/How do I use DMTCP with a parallel pool of MATLAB workers? · Issue #223 · dmtcp/dmtcp · GitHub
dmtcp - DMTCP: Distributed MultiThreaded CheckPointing matlab -nodisplay -r "parpool('local',4); parfor i=1:10, pause(1); fprintf('%i ',i); end; ...

Using MATLAB and SDR to Reverse Engineer 433MHz Messages
... so he focused on studying the methodology and the tools available for analyzing 433MHz RF transmission. He describes the process of using MATLAB ...

Resources last updated: 2/28/2016 11:53:25 PM