Matlab Functions with java

Hi friends.I have a many function that written in Matlab.Now I must use this functions in my
java project.If I write this fungtion again I will spend very musch time .I want to call this function from java
project how can I do it.
Edited by: Turkfutuh on Jul 14, 2008 3:00 PM

Solutions.
1. Find an existing Java interface library
2. Write a C executable, use the matlab library and write a communications api. Your java app talks to the communications API.
3. Write JNI code that does something similar to what is in 2.
Solutions 2 and 3 require a moderate level of experience in a programming language besides java, probably C or C++.
Solution 2 requires work in the communications api while 3 requires a similar amount of work via the JNI api.

Similar Messages

  • I hope to develop a function with java like IE's save as.How can I do?

    I hope to develop a function with java like IE's save as.How can I do?

    hi ,
    Considering IE browser page as an object, U can use Serialization where u can save that object.(i.e state of the object) And then when u open it thru de-serialization, u can restore the page/object .
    Hope that helps U .
    Techie.

  • How to use matlab function with labview?

    Hello,
    I just want to use some matlab functions like floor(),ones()... in my labview code, who can tell me how to do it?
     I want to only install MCR in my PC, so MATLAB script node can not work because it need matlab installed. 
    Thanks
    Solved!
    Go to Solution.

    floor() exists on the standard labview pallet already and the ones() function would be fairly simple to reproduce. If you only need a few basic functions repost asking for direction on recreating those specific methods. However, you're right - there is not a direct way to use compiled matlab code in labview without full matlab and the math script nodes. If you're really desparate to reuse some some exisiting IP there are C++ alternatives that implement many of the same methods and syntax as matlab (http://arma.sourceforge.net/faq.html). I'm fairly sure there are other tools that attempt to translate matlab code into pure c functions, both of which can be called via a DLL from within labview: https://decibel.ni.com/content/docs/DOC-9076
    Alternatively, here is an all NI linear algebra solution: http://sine.ni.com/nips/cds/view/p/lang/en/nid/210525

  • BAPI explorer functions with java

    I am a newbie in SAP.
    I have tested out some sample JCO programs. Then worked fine.
    Now I want to go for some more.
    Is it possible to implement applications like BAPI explorer with JCo ?
    Basically I want to be able to list all the BAPIs with JCo ?
    I have tried "RFC_FUNCTION_SEARCH" with "*" entry for all input values and
    the output was null. 
    How do I list all the BAPIs with JCo (Java Program)
    Thanks !!!!

    I was asking so obvious question with simple answer.
    I have figured it out and it worked great. It's been a week since I started JCo program.
    Anyway my problem was RFC_FUNCTION_SEARCH returns output in a table.
    So I had to look up the table for result message.
    Now I am asking another ? I have searched the forum already and couldn't find the answer.
    How do I create the hierarchical view of BAPI with JCo ?
    Basically I want to implement something like BAPI explorer (tree navigator) with Java.

  • Search function with Java script

    Hi, i'm using ADF 11g . In one of the application page , i need to give a search function , in which user can enter any text , the entered text needs to be highlighted . Since ADF is very new to me , could some one point me how to use the javascript API to do this. Thanks.

    Thanks for your response Shay.
    The function should be like the find function in (Ctl-F) in Firefox browser. (In IE the find function finds only the node of the xml not the value of the node displayed in outputText Component. )
    The page displays a xml file in a tree structure. The value of a node is displayed in the output text component.
    The requirement is , a search field will be given at the bottom of the page, where user can enter any text and the function should find and highlight the matching Node as well as values. If user hits the button again, the function should highlights the next match.
    You mentioned i can use a backing bean to find and highlight the words. does it mean i no need to use the javascript API. Could you point me some docs or any demo piece. Thanks again.

  • XSLT Enhancement with Java, Tokenize Functionality

    I tried the following requirement using EXSLT with no luck. Is there any other alternative to tokenize in XSLT 1.0.
    The syntax i have here is  
    <xsl:for-each select="tokenize($this/Field1,',')">
           <xsl:variable name="f1v" select="."/>
         <xsl:for-each select="tokenize($this/Field2,'\|')">
              <xsl:variable name="f2v" select="."/>
              <xsl:for-each select="tokenize($this/Field3,'\|')">
                        <xsl:variable name="f3v" select="."/>
    There are multiple for-each based on tokens
    I am leaning towards to Enhancing XSLT with Java Function. As i have less experience with Java, can anybody help me with the code that can be used by XSLT for Tokenize functionality.
    I have written something like following. I still have errors to fix. But i am not sure about having resultSet or return at the end, to make sure all the tokens were sent to XSLT.
    public class MyStringToken
         public static void main(String [] args)
              String str = "sssd;wwer;ssswwwwdwwwwwwwwwww;wwwwe";
              String delimiter = ";";
              MyStringToken my = new MyStringToken();
              my.getTokens(str,delimiter);
         public void getTokens(String str,String delimiter)
              StringTokenizer st = new StringTokenizer(str,delimiter);
              while(st.hasMoreElements())
                   try
                        String delString = new String(st.nextElement().toString());
                        return (delString);
                   catch(Exception e)
                        e.printStackTrace();
    Any help is appreciated

    Hi,
    I have been searching about, and I have found the next example that maybe can help you, It's a template to tokenize in XSLT 1.0 from the web [http://stackoverflow.com/questions/1018974/tokenizing-and-sorting-with-xslt-1-0]
    <xsl:template name="tokenize">
      <xsl:param name="string" />
      <xsl:param name="delimiter" select="' '" />
      <xsl:choose>
        <xsl:when test="$delimiter and contains($string, $delimiter)">
          <token>
            <xsl:value-of select="substring-before($string, $delimiter)" />
          </token>
          <xsl:text> </xsl:text>
          <xsl:call-template name="tokenize">
            <xsl:with-param name="string"
                            select="substring-after($string, $delimiter)" />
            <xsl:with-param name="delimiter" select="$delimiter" />
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <token><xsl:value-of select="$string" /></token>
          <xsl:text> </xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Also I have found the next example of use tokenize in EXSLT from [http://exslt.org/str/functions/tokenize/index.html] It can be that inI your tests you are not using "str:tokenize", no?
    <xsl:template match="a">
       <xsl:apply-templates />
    </xsl:template>
    <xsl:template match="*">
       <xsl:value-of select="." />
          <xsl:value-of select="str:tokenize(string(.), ' ')" />
       <xsl:value-of select="str:tokenize(string(.), '')" />
       <xsl:for-each select="str:tokenize(string(.), ' ')">
          <xsl:value-of select="." />
       </xsl:for-each>
       <xsl:apply-templates select="*" />
    </xsl:template>
    I hope that helps you.
    Best.
    Jorge

  • Interface Matlab with java good links and info

    HI All
    i want to interface Matlab with java
    i did search through the net but i haven't got nay good links and info
    by that i mean the given links either not working or do work for old version of matlab ie R13
    i have R14
    IF you have already done that or
    you have a really good links and info and steps
    please post them here
    thanks

    It doesn't appear that Matlab is free, so i'd expect that's why you are having trouble finding download links.
    Here's is an overview link
    http://www.mathworks.com/access/helpdesk/help/techdoc/rn/r14_v7_external.html#1011951

  • Replace the wait with java embedding thread.sleep() function

    Hi,
    How to replace the wait with java embedding thread.sleep() function. Can anyone help.
    Thanks.

    drag and drop the java embedding component
    include the following code in it.
    try{ 
    Thread.sleep(60000);
    }catch(Exception e)
    --Prasanna                                                                                                                                                                                                                                                                                                                           

  • On certain web sites(with java applets embedded or rich content),sometimes browser hotkeys are beeing used with other functionality (eg.: youtube uses ctrl + tab for sliding between player controls).How can I prevent this?

    On certain web sites(with java applets embedded or rich content),sometimes browser hotkeys are beeing used with other functionality (eg.: youtube uses ctrl + tab for sliding between player controls).How can I prevent this ?

    Thanks for posting this!
    I would only mention that your definition is incomplete for this -
    Contextual selector A type of Style Sheet Selector that
    and that it's most often referred to now as a Descendent selector, not a contextual selector.  It's basically the same as the Compound selector that you have already defined....

  • How to call java function with parameter from javascript in adf mobile?

    how to call java function with parameter from javascript in adf mobile?

    The ADF Mobile Container Utilities API may be used from JavaScript or Java.
    Application Container APIs - 11g Release 2 (11.1.2.4.0)

  • The troubles with creating SQL function in Java

    Hi!
    I use Oracle 10g and connect to it from Java application. I need in creating SQL functions from Java code.
    In Java I have:
    Statement stm = null; try{     stm = dbConnection.createStatement();     stm.executeUpdate( query ); }catch(SQLException ex){     throw ex; }finally{     try{ stm.close(); }catch(Exception ex){ stm.close(); } }
    And I'm passing the next SQL function:
    create or replace function get_me return number is
    result number;
    begin
    select 5 into result from dual;
    return result;
    end;
    This code is run successful, but I can't call this funtion, because it has status Invalid
    I'm looked the next error: PLS-00103: Encountered the symbol "" when expecting one of the following: . @ % ; is authid as cluster order using external character deterministic parallel_enable pipelined aggregate
    But I don't understand, What the matter? From Oracle Enterprise Manager I can create this function without problems. So, I wrote the wong Java code. Also, I can't find my error :(
    May be, do u have the some ideas?
    Thank you very much!

    Post the whole pl/sql code please.
    To run PL/SQL from within java you'll need callablestatement.
    [here |http://www.idevelopment.info/data/Programming/java/jdbc/PLSQL_and_JDBC/CallPLSQLFunc.java] an example : http://www.idevelopment.info/data/Programming/java/jdbc/PLSQL_and_JDBC/CallPLSQLFunc.java

  • Running Matlab code from java code

    Ok so I need to make a java gui interface to run Matlab code. After a lot of search I am aware of three approaches,the com.mathworks.jmi package, JNI and i/o streams. So as far as the first approach I cannot find that package nowhereto downlaod, so please if anyone knows where to find it, or why I cannot find it... As far as the second and third approach, I need this to run on both linux and windows so JNI is the only way. So first of all if someone has another approach to suggest, I would like to hear! So I have found code to do this but it is not working and the problem is that there is c code in all this, and my c knowledge is not good at all, so as you have probably understand this is more like a c problem than java, but I'm not completely sure. Anyway I'm posting all the code I use, then the commands I used to compile it and at last the problem.
    Engine.java
    package MatlabNativeInterface;
    import java.io.*;
    * <b>Java Engine for Matlab via Java Native Interface (JNI)</b><br>
    * This class demonstrates how to call Matlab from a Java program via
    * JNI, thereby employing Matlab as the computation engine.
    * The Matlab engine operates by running in the background as a separate
    * process from your own program.
    * <p>
    * Date: 04.04.03
    * <p>
    * Copyright (c) 2003 Andreas Klimke, Universit&#65533;t Stuttgart
    * <p>
    * Permission is hereby granted, free of charge, to any person
    * obtaining a copy of this software and associated documentation
    * files (the "Software"), to deal in the Software without
    * restriction, including without limitation the rights to use, copy,
    * modify, merge, publish, distribute, sublicense, and/or sell copies
    * of the Software, and to permit persons to whom the Software is
    * furnished to do so, subject to the following conditions:
    * <p>
    * The above copyright notice and this permission notice shall be
    * included in all copies or substantial portions of the Software.
    * <p>
    * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
    * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    * OTHER DEALINGS IN THE SOFTWARE.
    * @author W. Andreas Klimke, University of Stuttgart
    *         ([email protected])
    * @version 0.1
    public class Engine {
         * Calls the function <code>engOpen</code> of Matlab's C Engine library.
         * Excerpts from the Matlab documentation:
         * "On UNIX systems, if startcmd is NULL or the empty string,
         * <code>engOpen</code> starts MATLAB on the current host using the
         * command <code>matlab</code>. If startcmd is a hostname, <code>engOpen
         * </code> starts MATLAB on the designated host by embedding the specified
         * hostname string into the larger string:
         * <code>rsh hostname \"/bin/csh -c 'setenv DISPLAY\ hostname:0; matlab'\"
         * </code>. If startcmd is any other string (has white space in it, or
         * nonalphanumeric characters), the string is executed literally to start
         * MATLAB. On Windows, the startcmd string must be NULL."<br>     
         * See the Matlab documentation, chapter "External Interfaces/API
         * Reference/C Engine Functions" for further information.
         * @param startcmd The start command string.
         * @throws IOException Thrown if starting the process was not successful.
      public native void open(String startcmd) throws IOException;
          * Calls the function <code>engClose</code> of Matlab's C Engine
          * library.     This routine allows you to quit a MATLAB engine session.
          * @throws IOException Thrown if Matlab could not be closed.
         public native void close() throws IOException;
         * Calls the function <code>engEvalString</code> of Matlab's C Engine
         * library. Evaluates the expression contained in string for the MATLAB
         * engine session previously started by <code>open</code>.
         * See the Matlab documentation, chapter "External Interfaces/API
         * Reference/C Engine Functions" for further information.
         * @param str Expression to be evaluated.
         * @throws IOException Thrown if data could not be sent to Matlab. This
         *                     may happen if Matlab is no longer running.
         * @see #open
      public native void evalString(String str) throws IOException;
          *  Reads a maximum of <code>numberOfChars</code> characters from
          * the Matlab output buffer and returns the result as String.<br>
          * If the number of available characters exceeds <code>numberOfChars</code>,
          * the additional data is discarded. The Matlab process must be opended
          * previously with <code>open()</code>.<br>
          * @return String containing the Matlab output.
          * @see #open
          * @throws IOException Thrown if data could not be received. This may
          *                     happen if Matlab is no longer running.
      public native String getOutputString(int numberOfChars);
          * Initialize the native shared library.
      static {
             System.loadLibrary("Engine");//I have changed this
         //System.loadLibrary("engineJavaMatlab");
         System.err.println("Native Matlab shared library loaded.");
    }Engine.c
    #include <jni.h>
    #include "MatlabNativeInterface_Engine.h"
    #include <stdio.h>
    #include "engine.h"
    #define DEFAULT_BUFFERSIZE 65536
    Engine* ep;
    char outputBuffer[DEFAULT_BUFFERSIZE];
    JNIEXPORT void JNICALL
    Java_MatlabNativeInterface_Engine_open(JNIEnv *env, jobject obj, const jstring startcmd) {
      const char *c_string = (*env)->GetStringUTFChars(env, startcmd, 0);
      if (!(ep = engOpen(c_string))) {
        jclass exception;
        (*env)->ReleaseStringUTFChars(env, startcmd, c_string);
        exception = (*env)->FindClass(env, "java/io/IOException");
        if (exception == 0) return;
        (*env)->ThrowNew(env, exception, "Opening Matlab failed.");
        return;
      (*env)->ReleaseStringUTFChars(env, startcmd, c_string);
         /* indicate that output should not be discarded but stored in */
         /* outputBuffer */
      engOutputBuffer(ep, outputBuffer, DEFAULT_BUFFERSIZE);
    JNIEXPORT void JNICALL
    Java_MatlabNativeInterface_Engine_close(JNIEnv *env, jobject obj) {
         if (engClose(ep) == 1) {
           jclass exception;
        exception = (*env)->FindClass(env, "java/io/IOException");
        if (exception == 0) return;
        (*env)->ThrowNew(env, exception, "Closing Matlab failed.");
        return;
    JNIEXPORT void JNICALL
    Java_MatlabNativeInterface_Engine_evalString(JNIEnv *env, jobject obj, const jstring j_string) {
      const char *c_string;
         c_string = (*env)->GetStringUTFChars(env, j_string, 0);
      if (engEvalString(ep, c_string) != 0) {
           jclass exception;
        exception = (*env)->FindClass(env, "java/io/IOException");
        if (exception == 0) return;
        (*env)->ThrowNew(env, exception, "Error while sending/receiving data.");
      (*env)->ReleaseStringUTFChars(env, j_string, c_string);
    JNIEXPORT jstring JNICALL
    Java_MatlabNativeInterface_Engine_getOutputString(JNIEnv *env, jobject obj, jint numberOfChars) {
      char *c_string;
         jstring j_string;
         if (numberOfChars > DEFAULT_BUFFERSIZE) {
              numberOfChars = DEFAULT_BUFFERSIZE;
      c_string = (char *) malloc ( sizeof(char)*(numberOfChars+1) );
         c_string[numberOfChars] = 0;
      strncpy(c_string, outputBuffer, numberOfChars);
         j_string = (*env)->NewStringUTF(env, c_string);
         free(c_string);
      return j_string;
    }MatlabNativeInterface_Engine.h (as produced by javah)
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class MatlabNativeInterface_Engine */
    #ifndef _Included_MatlabNativeInterface_Engine
    #define _Included_MatlabNativeInterface_Engine
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     MatlabNativeInterface_Engine
    * Method:    open
    * Signature: (Ljava/lang/String;)V
    JNIEXPORT void JNICALL Java_MatlabNativeInterface_Engine_open
      (JNIEnv *, jobject, jstring);
    * Class:     MatlabNativeInterface_Engine
    * Method:    close
    * Signature: ()V
    JNIEXPORT void JNICALL Java_MatlabNativeInterface_Engine_close
      (JNIEnv *, jobject);
    * Class:     MatlabNativeInterface_Engine
    * Method:    evalString
    * Signature: (Ljava/lang/String;)V
    JNIEXPORT void JNICALL Java_MatlabNativeInterface_Engine_evalString
      (JNIEnv *, jobject, jstring);
    * Class:     MatlabNativeInterface_Engine
    * Method:    getOutputString
    * Signature: (I)Ljava/lang/String;
    JNIEXPORT jstring JNICALL Java_MatlabNativeInterface_Engine_getOutputString
      (JNIEnv *, jobject, jint);
    #ifdef __cplusplus
    #endif
    #endifand a Main.java
    import MatlabNativeInterface.*;
    import java.io.*;
    * Demonstration program for connecting Java with Matlab using the Java
    * Native Interface (JNI). Wrapper functions access Matlab via Matlab's
    * native C Engine library.
    public class Main {
         public static void main(String[] args) {
              Engine engine = new MatlabNativeInterface.Engine();
              try {
                   // Matlab start command:
                   engine.open("matlab -nosplash -nojvm");
                   // Display output:
                   System.out.println(engine.getOutputString(500));
          // Example: Solve the system of linear equations Ax = f with
                   // Matlab's Preconditioned Conjugate Gradients method.
                   engine.evalString("A = gallery('lehmer',10);");  // Define Matrix A
                   engine.evalString("f = ones(10,1);");            // Define vector f
                   engine.evalString("pcg(A,f,1e-5)");              // Compute x
                   // Retrieve output:
                   System.out.println(engine.getOutputString(500));
                   // Close the Matlab session:
                   engine.close();
              catch (Exception e) {
                   e.printStackTrace();
    }so I compile them with:
    javac -d classes @files.txt
    javah -classpath classes MatlabNativeInterface.Engine
    cc -shared -I/usr/java/jdk1.6.0_06/include/ -I/usr/java/jdk1.6.0_06/include/linux/ -I/usr/local/share/matlab7.6/extern/include/ Engine.c -o libEngine.soso everything gets compiled well and then I run Main:
    /javas/classes/_>mv libEngine.so classes/
    /javas/classes/_>cd classes/
    /javas/classes/_>java -Djava.library.path=. Main
    Exception in thread "main" java.lang.UnsatisfiedLinkError: /javas/classes/libEngine.so: /javas/classes/libEngine.so: undefined symbol: engOpen
            at java.lang.ClassLoader$NativeLibrary.load(Native Method)
            at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
            at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
            at java.lang.Runtime.loadLibrary0(Runtime.java:823)
            at java.lang.System.loadLibrary(System.java:1030)
            at MatlabNativeInterface.Engine.<clinit>(Engine.java:99)
            at Main.main(Main.java:11)So... please help!

    I need this to run on both linux and windows so JNI is the only wayHuh? Streams in general work on windows and linux. So maybe some more specific info
    about what you mean by "i/o streams."
    I am aware of three approachesA fourth approach is to write an application in C which communicates with Matlab directly
    and then uses some idiom such as sockets to allow communication to java. This would generally
    be the method that I would prefer over all others since it makes debugging and testing easier.
    undefined symbol: engOpenSomehow you are missing a library (nothing specific to to with JNI nor java) in you JNI code.
    Odd error since I would normally expect something else. Try using System.load/loadLibrary() in java to explicitly load the Matlab
    library (or libraries) before your JNI library. The load/LoadLibrary calls don't care if it is JNI or not.

  • Perform Hamming window and FFT with Java

    Hi all,
    I am trying to apply Hamming window on my lengthy sound data soundSample[1000] with window length 100. Then proceed with FFT.
    And i found that java does have the package for Hamming window and FFT. As below,
    http://code.compartmental.net/minim/javadoc/ddf/minim/analysis/FFT.html
    http://marf.sourceforge.net/api/marf/math/Algorithms.Hamming.html
    But i hardly find an example that illustrate how to use the package in a java program. So no idea how should i use the method in package.
    Please advise and appreciate if reference is provided.
    Thank you.

    Hi,
    I have spent sometimes to study and do the coding for FFT on audio samples.
    My project is to study the FFT working by performing the FFT on audio sampled data.
    After this is done, then only proceed to extract the pitch value in the audio data.
    Below is the coding that i have done by referring to the provided steps:
    In my main, i call this method and past the retrieved sampled sound data to this method.
    public static void Analyze(int[] soundSample,float sample_rate ) {
            int N = (int)sample_rate/5;
            int Number_Sample = soundSample.length;
            Complex[] fftBuffer = new Complex [2*N];
            Complex[] fftResult = new Complex [2*N];
            Complex [] lastN = new Complex [N];   // The array to save the last N sample
            int delay = 0;
            double delta = 2*Math.PI/(2*N);
            // I have no idea how can i convert my sample array to double so that it will be in the range of [-1,+1]
            while(delay <=soundSample.length){
                //Extract the 2N sample for FFT analysis and convert the data to complex number.
                for (int z=0; z<2*N; z++){
                    fftBuffer[z] = new Complex(soundSample[z+delay],0) ;                
                for (int i=N-1;i>=N/2; i-- ){
                    lastN[N-1-i] = fftBuffer;
    for (int z=0; z<2*N; z++){
    fftBuffer[z] = fftBuffer[z].times(0.54-0.46*Math.cos(z*delta));
    fftResult = FFT1.fft(fftBuffer);
    delay = 2*N + delay;
    1) I was trying to perform FFT with 2N samples then keep on looping the FFT method until 2N reaches the ends of sampled data.
    But the FFT that i am working with is radix 2... It doesn't work with my 2N samples... Please teach me how should i work out FFT regardless the number of sample?
    2) The hamming window coefficient i m using is based on http://www.mathworks.com/help/toolbox/signal/hamming.html . I am working on index [0:2N] ..
    Is it appropriate?
    3) According to your No1 steps, the acceptable frequency resolution is 5Hz. May i know what is this representing? And is it application for most of the FFT application? How can i determine the frequency resolution that i should used in my project?
    Sorry for late reply as i was trying to work out the thing..
    Hereby attach to your the my coding.. and hopes to have your guidance and tutorial how to extract the pitch for recording audio file with Java.
    I have done the pitch extraction with MATLAB.. but Matlab as built-in FFT function... 
    So i m now get stucked how to perform FFT on audio sound sample regardless the N value of sound sample for FFT buffer.
    Many thanks for your former advise... and
    Looking forward for your replies again.
    Happy New Year 2011 :)
    Edited by: 诸葛 on Dec 31, 2010 9:29 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Matlab program to Java application

    Hi, I have to transform a Matlab program to a Java application (with a nice GUI). What's your opinion to the two possibilities:
    1. Calling Matlab out of the java code with a library called com.mathworks.jmi. I don't find much on the net about it. Does anyone know if it works reliable and if I can get the three dimensional plots and present it in my java GUI?
    2. All the existing Matlab scripts have to be rewriten into java. That looks like to much work to me. What would you use to present simple three dimensional bodies? Java 3D? Is there any nice library to use for 3D plots in a xyz coordinate system?
    Thanks!

    Hi,
    I have worked few years back to call Matlab programs from Java. The only option i could find from the resources available then is to write a C program to make a call to this Matlab code, convert this C program to dll file and then call it using Java's JNI api.
    If you feel the back end functionality implemented in Matlab is very complex and time consuming to convert into Java, then i would advice you to code all the UI related stuff in java and then make calls to back end in Matlab to display the info( in the form of graphs). But i should warn you that you should look for the mode to transfer info(like arrays) between Java and Matlab via JNI and dll files, also you should take care of multithreading. I should also warn you that this process is not very good in terms performance and response time.
    But if you need good response time then i would advice you to code everything in Java. Hope this helps!!!

  • Sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loop

    sir i have given lot of effort but i am not able to solve my problem either with notifiers or with occurence fn,probably i do not know how to use these synchronisation tools.

    sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loopHi Sam,
    I want to pass along a couple of tips that will get you more and better response on this list.
    1) There is an un-written rule that says more "stars" is better than just one star. Giving a one star rating will probably eliminate that responder from individuals that are willing to anser your question.
    2) If someone gives you an answer that meets your needs, reply to that answer and say that it worked.
    3) If someone suggests that you look at an example, DO IT! LV comes with a wonderful set of examples that demonstate almost all of the core functionality of LV. Familiarity with all of the LV examples will get you through about 80% of the Certified LabVIEW Developer exam.
    4) If you have a question first search the examples for something tha
    t may help you. If you can not find an example that is exactly what you want, find one that is close and post a question along the lines of "I want to do something similar to example X, how can I modify it to do Y".
    5) Some of the greatest LabVIEW minds offer there services and advice for free on this exchange. If you treat them good, they can get you through almost every challenge that can be encountered in LV.
    6) If English is not your native language, post your question in the language you favor. There is probably someone around that can help. "We're big, we're bad, we're international!"
    Trying to help,
    Welcome to the forum!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for

  • Using Time Capsule to store iTunes library

    I use my 1 TB Time Capsule to store my iTunes library and point my iTunes to where it is stored in the Preferences/Advanced section of iTunes. However, iTunes often reverts to the old storage location on my MacBook Pro. Is there another folder or set

  • Mac Mail is continuously adjusting the "allow insecure authorization" option on it's own

    I've already lost 3 clients due to a lack of timely email response, and I had no idea why Mac Mail was having issues connecting to my email server. I've spoken at length with my web hosting support, and it turns out the options in Mac Mail for "Autom

  • Itunes content cutting off while streaming to apple tv

    After the 4.2.2 software update, my Apple TV suddently stops playing any type of media from my iTunes library (video or audio). It has not affected Netflix streaming or Youtube at all. The cutoff is seamingly random; sometimes it plays almost all the

  • Settlement cost element

    Dear All, I have settlement defined in pa transfer structure, if at the same time I have more than 1 cost element to settle to different value field in copa, can the secondary cost element in settlement able to settle 2 or 3 different cost element to

  • TL 11g: JPA and DB proxy authentication?

    Hi! I posted similar question of JDev 11g forum, but I hope I can get more profound expertise here :))) OK. I want to make a proof-of-concept for end-to-end security using a novel 11g technology: I want to use EJB 3.0 / JPA (TopLink) and to enable su