f



Invoking MATLAB from Windows and Linux Using Java

How to invoke MATLAB Services from Windows and Linux Using Java? Is there any common interface for this? 
0
9/22/2009 11:09:19 AM
comp.soft-sys.matlab 211264 articles. 26 followers. lunamoonmoon (257) is leader. Post Follow

0 Replies
995 Views

Similar Articles

[PageSpeed] 48

Reply:

Similar Artilces:

Invoking MATLAB from Windows and Linux Using Java #2
How to invoke MATLAB Services from Windows and Linux Using Java. Is there any common interface for this? ...

A Matlab (Windows 64bits) to Java (Linux 32bits) converter
Hi everybody, I am faced to a problem I am trying to solve for one week at full time. :-( I have a Matlab program without input argument. I have written it in a windows 64bits Matlab. I now need to translate this code into a java (Eclipse) source that will be used from a maximum 512MB Ram device. I cannot use the Matlab Builder JA because the MATLAB Compiler Runtime (MCR) needs at least 1GB Ram. I desperatly trying to find a solution, in vain! Nobody could help me? Is my problem clear enough? "lala " <thib712@hotmail.com> wrote in message <jjvlnh$7k3$1@newscl01ah.mathworks.com>... > Hi everybody, > > I am faced to a problem I am trying to solve for one week at full time. :-( > I have a Matlab program without input argument. > I have written it in a windows 64bits Matlab. > I now need to translate this code into a java (Eclipse) source that will be used from a maximum 512MB Ram device. I cannot use the Matlab Builder JA because the MATLAB Compiler Runtime (MCR) needs at least 1GB Ram. I desperatly trying to find a solution, in vain! ...

send a file from linux PC to windows PC using matlab
Dear Group, I have a linux computer on which I have installed matlab. And this linux computer is networked to another windows computer using samba. I shared the C drive of windows PC with linux PC. (This C drive is not mounted on linux PC) I do some calculation on matlab on linux and after that I want to move some text files from linux to windows C drive. Is there any way matlab can send this text file directly to windows C drive using the IP address of windows PC? For example, movefile('/home/patel/test.txt', 'smb://192.168.2.1/patel/test.txt ') does not work. I can't mount C drive on linux media because I don't have root password for linux. Please give some other suggestions. Thanks, Gopesh ...

C++ Mex file crashes matlab on 64bit linux, but not 32 bit windows, but program runs fine outside Matlab
Hello, I have written a mex gateway function to a C++ class. If I compile this mex function on 32Bit windows using R2008a I have no problems. If I compile and run on Matlab R2011a running 64bit Scientific Linux (a version of Red Hat Enterprize Linux) matlab exits with a segfault when the mexfunction is called, although it appears to run about halfway through the program. The C++ class can be compiled and run (with a main function) outside of Matlab on both platforms with no errors. I am using Microsoft Visual C++ Express Edition on the windows machine, and gcc 4.4.5 on the Linux machine. Can anyone suggest what the cause of this might be and how I can I fix it? I am having a hard time debugging on Linux as I do not have access to a graphical debugger for use with matlab and am unfamiliar with gdb. This is compounded by the fact that the program compiles and runs fine when compiled as a standalone program. A zip file containing the code and data files necessary to reproduce the problem can be downloaded from http://www.see.ed.ac.uk/~s0237326/downloads/mexcrash.zip. This zip file contains the .m and .cpp source code, and a text file for testing (Temp.fem). The file fmehsersetup.m shows the commands I am using to compile. The file Test_mexfmesher.m runs the mexfunction with an appropriate input for testing. The mex gateway function is mexfmesher.cpp, it calls the fmesher class which is made up of the files in the fmesher directory. Below is a backtrace from the se...

Creating DLL in Matlab and using them in Matlab?
Hi, is it possible to create dll in Matlab and then using it in other Matlab apllication? I've made a simple function and put it into dll. But when I try to use this library in other apllication written in matlab it doesn't works. Any idea? -- Pozdrawiam, e-Shrek hi e-shresk, I once created a matlab dll, and called it in c code. it worked. I guess you have to check whether you dll was built correctly or not. ps. why don't u call matlab function directly? Dnia Mon, 26 Oct 2009 07:19:04 +0000 (UTC), Jun napisa�(a): > hi e-shresk, > > I once created a matlab dll, and called it in c code. it worked. Hmmm. The function is very simple: ========================== function var_o = testlib(var_i) if var_i == '1', var_o = 'jest'; else var_o = 'brak'; end ========================== Compilation: mcc -W lib:xlib -T link:lib testlib After it, I have *.dll *.lib *.h Tryin' to load library: loadlibrary('xlib.dll','xlib.h'); The result is: Warning: Warnings messages were produced while parsing. Check the functions you intend to use for correctness. Warning text can be viewed using: [notfound,warnings]=loadlibrary(...) > In loadlibrary at 394 Where is the problem? > ps. why don't u call matlab function directly? I have a pack of functions that I wouldlike to use with few different matlab compiled programs. -- Pozdrawiam, e-Shrek On Oct 26, 1:47=A0pm, e-Shrek <e-Shrek.wyt...@wytni...

MATLAB Windows/Linux
We have a MATLAB 7.12.0 compute engine consisting of 16 parallel CPUs (RH Linux). I then send output and display on a remote machine also running RH and MATLAB 7.12, if that matters. Now I'd like to display on a Windows machine instead; this machine has MATLAB R2010b. I asked our local administrator and he responded as follows: >In my understanding of matlab, you might be able to install >matlab locally on your windows machine and configure it to >connect client/server to penguin. Or you can install an X >windows application (Exceed/Xming) with IASO approval and >the assistance of the PC helpdesk. Then via putty you can >create an ssh tunnel to the server and send back the Matlab >display. Probably the answer is here. But if a step-by-step description exists elsewhere, or maybe different wording by someone would help me. Thank you. Andrew M. Neiderer US Army Research Laboratory ...

slow optimization using nonlcon with GA within matlab toolbox and mixed integer problem using GA within Matlab
greeting all, i'm using nonlcon(nonlinear inequality constraint) with GA from the toolbox provided by matlab. does anyone notice the extreme slowlness in evaluating nonlinear constraint as compared to other linear constraint? my problem for nonlinear constraint is as follow c(1)=x+y^2-2*ones(N,1) where x and y are Nx1 vector. which means if N increases, the size of constraint increases. and to clarify, the min problem is sometime like min c'z where z=[x;y], which means x and y are some range of variable within z(just a matter of problem formulation) well, is there anyone with other alternative or is it possible or method in including non-linear constraint directly to fitness function? (well, actually nonlcon deals nonlinear constraint by using Augmented Lagrangian Pattern Search from what i see from the help file, or am i wrong?) and one more question, is there anyone that attempt to attempt to apply mixed integer problem into the GA in matlab? For now, i can only switch before pure integer or pure real number problem, but not mixed at the moment. I will be trying to add in some repair operator to fix up the variable that needs to be integer and other remaining in real number. I'm not sure why you are using ga to solve your problem. Did you find fmincon unsatisfactory in any way? Alan Weiss MATLAB mathematical toolbox documentation On 5/10/2011 11:53 PM, terry wrote: > greeting all, > > i'm using nonlcon(nonlinear inequality constraint)...

using java and weka in matlab
Hello All, I would like to perform a weka (machine learning) command in matlab. Outside of matlab, the following weka / java command works correctly: $ java -cp /odwyer/weka-3-6-4/weka.jar weka.filters.supervised.attribute.AttributeSelection -E "weka.attributeSelection.ReliefFAttributeEval -M -1 -D 1 -K 10" -S "weka.attributeSelection.Ranker -T -1.7976931348623157E308 -N 500" -i moo.arff > moo_reduced.arrf I would now like to perform the same command inside matlab, but am not sure how to do this. I have tried the following in matlab: ################################################# javaaddpath('/netapp/vol1_homeunix/odwyer/weka-3-6-4/weka.jar'); import weka.filters.supervised.attribute.AttributeSelection import weka.attributeSelection.ReliefFAttributeEval import weka.attributeSelection.Ranker !java weka.filters.supervised.attribute.AttributeSelection -E "weka.attributeSelection.ReliefFAttributeEval -M -1 -D 1 -K 10" -S "weka.attributeSelection.Ranker -T -1.7976931348623157E308 -N 500" -i moo.arff > moo_output.arrf ################################################## I get the following error: ############################################### Exception in thread "main" java.lang.NoClassDefFoundError: weka/filters/supervised/attribute/AttributeSelection Caused by: java.lang.ClassNotFoundException: weka.filters.supervised.attribute.AttributeSelection at ja...

Using Java Timer in Matlab
I'd like to use a Java Timer (util.java.Timer) instead of matlab timer object. My only problem is that Java Timer Class need to define a TimerTask derived class with the proper run() method. How can i invoke Matlab code in the run method? Thanks in advice for any useful information "Marco " <francociccio@hotmail.com> wrote in message <hm8mcc$1rj$1@fred.mathworks.com>... > I'd like to use a Java Timer (util.java.Timer) instead of matlab timer object. My only problem is that Java Timer Class need to define a TimerTask derived class with the proper run() method. How can i invoke Matlab code in the run method? > > Thanks in advice for any useful information You'll need to use JMI to call Matlab from Java. Note however, that JMI needs to wait for the main Matlab computational thread, so the benefits of using a Java thread may be diminished. Yair Altman http://UndocumentedMatlab.com "Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message <hmbnmo$eue$1@fred.mathworks.com>... > "Marco " <francociccio@hotmail.com> wrote in message <hm8mcc$1rj$1@fred.mathworks.com>... > > I'd like to use a Java Timer (util.java.Timer) instead of matlab timer object. My only problem is that Java Timer Class need to define a TimerTask derived class with the proper run() method. How can i invoke Matlab code in the run method? > > > > Thanks in advice for any useful information > &...

PriorityQueue in MATLAB using JAVA
Hi, I created a PriorityQueue by using this command. >>P = java.util.PriorityQueue; But there is a problem when adding elements. I can only add the first element. The command I used was >>P.add({1,1}); When i try to add more i get the below error ----------------------------------------------------------------------------- ??? Java exception occurred: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.lang.Comparable at java.util.PriorityQueue.siftUpComparable(Unknown Source) at java.util.PriorityQueue.siftUp(Unknown Source) at java.util.PriorityQueue.offer(Unknown Source) at java.util.PriorityQueue.add(Unknown Source) ------------------------------------------------------------------------------ Why is that ? What is the solution ?? ...

matlab 7.1 use matlab C++ math library
I wanna use matlab C++ math library into VC++6.0, but my matlab is 7.1. if i wanna use matlab C++ math library to programme, how can i setup my VC link?? why matlab7.1 doesn't have "extern->include->cpp" file??? In using matlab C++ math library , what difference between matlab 6.X and matlab7.1??? ...

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, but the reverse method is not. Evidently, parsing a string like the one above is a non trivial task and I'm loath to attempt writing one by myself. I would be very thankful if someone can point me to the required parser implementation. Matlab itself is carrying out this task all the time, perhaps it is possible to access Matlab's own parser. Help much appreciated, Ritesh ...

Using JNI to call MATLAB from JAVA
Hi guys, I need some help! I actually build a direct connection from JAVA to MATLAB using JMI! Now I just want to use JNI for the connection. There are actually some instructions for doing that. But it will not work ! I'm using Win7 and MATLAB 7.10.0(R2010a). I compiled the following code in C to a dll. ----------------------------------------------------------------------------------------------------------------- #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...

remote matlab from linux to windows 7
I would like to launch a matlab session through a putty ssh into a linux machine. I have installed ssh and xorg-x11-xauth on my linux machine. My X11 forwarding is set to yes in sshd_config. When I login and type matlab at my prompt, I get: unable to open display 'localhost:10.0' You will not be able to display graphics on the screen. If I set my display in the bash shell to my desktop windows 7 machine, I get the same answer with the new address instead of 'localhost:10.0'. I am sure this has been solved many times before, but I couldn't find it under the newsreader. Thanks The tramadol spam has gotten more views than this thread. Depressing. "Matthew" <matthew.merritt.nospam@utsouthwestern.edu> wrote in message <ire16o$7ap$1@newscl01ah.mathworks.com>... > I would like to launch a matlab session through a putty ssh into a linux machine. I have installed ssh and xorg-x11-xauth on my linux machine. My X11 forwarding is set to yes in sshd_config. When I login and type matlab at my prompt, I get: > > unable to open display 'localhost:10.0' You will not be able to display graphics on the screen. > > If I set my display in the bash shell to my desktop windows 7 machine, I get the same answer with the new address instead of 'localhost:10.0'. > > I am sure this has been solved many times before, but I couldn't find it under the newsreader. > > Thanks ipconfig on windows machine s...

use a C code in matlab (Linux)
Hi, I try to use C code as a function in my matlab code... This code was originally created for Windows users and compiled in .dll . In fact I just want to know how to create a equivalent of a .dll file in linux. thx On 15 Feb, 09:31, "Pierre " <pi.b...@gmail.com> wrote: > Hi, > I try to use C code as a function in my matlab code... This code was orig= inally =A0created for Windows users and compiled in .dll . > In fact I just want to know how to create a equivalent of a .dll file in = linux. The question is trivial, but the solution might not be. Well, it almost certainly is not. Windows and linux are two different operating systems (OSs). That is, two different ways to handle the interface between the hardware inside the computer, and the software that is supposed to run on the computer. Even if the two OSs run on the same hardware platform, the solutions chosen for a number of common tasks - like how to organize and integrate libraries - can differ very substantially. In other words: You need to re-compile the library from the C source code. Even if you get hold of that source code you are not done. At a bare minimum you will have to change certain library interface issues - the ways functionality inside the library is exposed to the calling programs. But this is not all - you will almost certainly need to do more: C and C++ are standardized languages in the sense that a standard defines a *minimum* supported set of functions, keywords and ...

time trial version of matlab compiled code using the matlab compiler
is there any way to create a time trial version of a program compiled using the matlab compiler? ...

engOpen on Linux: Matlab command window does not appear
Hello, I am running Matlab R2011a on Linux RedHat 5.6 (Cent OS). I am calling engOpen("\0") in my C code. The call succeeds, the Matlab process starts but the Matlab command window does not appear. I have tried the command engSetVisible with no success. Any idea? Help is greatly appreciated, Olivier ...

Matlab engine with matlab R2010b
Hello All, I'm working with an aplication that use the matlab engine. I made the C++ program and it is working well in my pc with matlab 2007b, but the same very basic program shows an error when I tried to compile it in a pc with matlab R2010b. The error is about the icuuc32.dll. ¿Why is asking this DLL? How can I solve this?. Thanks¡ ...

matlab use
suggest me the online tutorial of MATLAB . On 2/27/2012 2:06 AM, azim kumar wrote: > suggest me the online tutorial of MATLAB . Best way to learn any language is to solve a simple problem you are familiar with. This way you know what the answer should be, and it is a matter of coding it to obtain the answer, and you'd have a goal to work for. Matlab itself has many on-line tutorials. Help->Online tutorials. --Nasser ...

What is the best way to import Excel files, with stock data, into Matlab? I’m using Matlab R2010b (64-bit)
What is the best way to import Excel files, with stock data, into Matlab? I’m using Matlab R2010b (64-bit) I’m trying to import historical prices of stock data. Matlab keeps cutting off the header of each column; it gives me only values. I am thinking that this is a data-type-mixing-issue, or whatever it’s called. I have ‘Dates’ in ColumnA, and ‘MSFT’, ‘PWER’, ‘KO’, and ‘SBUX’, in ColumnB-ColumnE. Basically, if I put the Excel file in my Matlab folder and double-click the file, I see the values in a matrix (no dates and no headers), I hit ‘Next’. Then, I see only one option; one radio button is enabled – ‘Create variable matching preview’. The other two options, ‘Create vectors from each column using column names’ and ‘Create vectors from each row using row names’ – both are greyed out. I’ve seen videos, on YouTube and on the Matlab site, where people import excel data and these options are NOT greyed out. No matter what I do, there options are ALWAYS greyed out. The problem is, when I click ‘Finish’ in my ‘Workspace’ I have a variable named ‘data’ all values in a 575x4 matrix, but I have NO DATES and I have NO HEADERS on the columns. All of this seems to go into another variable, called ‘textdata’; all dates and headers ate in textdata. This is VERY inconvenient. I’m trying to analyze some stock data and I have no headers, so I have no idea which stock is which (I can figure it out, but I think Matlab should do this for me). Also, I have no dates corresponding to ...

How to use MATLAB's capabilities from JAVA coded programs
Hi, I am a final year student and am currently doing a project that requires me to develop GUIs for simulation of dynamical systems. I have conventionally been a JAVA programmer and haven't had much experience with MATLAB. My recent play around with MATLAB was not as pleasant as I expected it to be ,as I took quite some time to get used to the format and syntaxes,functions,etc. Moreover I found the MATLAB environment to be not as sophisticated as Eclipse. BUT I was really impressed by MATLAB's graphing abilities and how easy it was to use them. Therefore, I was wondering if it is possible to code the program in JAVA but be able to use MATLAB's graphing functions and other functions by simply calling functions from JAVA. Ideally I am looking for a solution where I code in JAVA and then call MATLAB functions (like plot,etc) which would give me back either resultant data or draw the graph itself. I did a search on the internet regarding this and it was not very clear. Thanks! P.S.- I am currently running MATLAB 7.8.0(R2009a). ...

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 ...

Spawning matlab from within matlab
Hello all, I would like to spawn multiple matlab processes from an '.m' script. Meaning, run an m-file from a 'parent' Matlab that launches, say, 8 more 'children' matlab processes. I'd like to do it in such a way that the same m-file in the 'parent' is able to close down, or kill, all the 'children' processes. Any suggestions? Joe ...

Developing Applications for Windows Mobile 6.1 Using Matlab
Hi all, I'm developing an application for Windows Mobile 6.1 Professional operating system. I have made some research and I found that when deploying a mobile application on the Windows Mobile OS you can either write native code with Visual C++, or write managed code that works with the .NET Compact Framework. Is either of the two possible with a Matlab R2008b code? And how? Thank you~ ...

Web resources about - Invoking MATLAB from Windows and Linux Using Java - comp.soft-sys.matlab

Invoking the power... - Flickr - Photo Sharing!
Strobist: gridspot on face, one flash behind model on a low stand, hairlight on top of the rack camera right (snooted but still visible, removed ...

Senate Republican Leaders Push a Yes Vote On Invoking Cloture on House Bill - YouTube
Cruz: A vote for cloture is a vote for Obamacare http://www.politico.com/blogs/politico-live/2013/09/cruz-a-vote-for-cloture-is-a-vote-for-o ...

Invoking God, Rowan County Clerk Kim Davis refuses to issue same-sex marriage licenses - CTV News
A county clerk in Kentucky has again refused to issue marriage licenses to gay couples, invoking her religious beliefs and 'God's authority'- ...

Cop To Cameraman: ‘If You’re Invoking Your Rights, You Must Be Doing Something Wrong’
America in the 21st Century is not as up on the Bill of Rights as you'd hope.

Alabama judges are invoking Jim Crow laws to avoid issuing marriage licenses
In case there was any confusion about the fact that social conservatives’ massive resistance to same-sex marriage is a direct descendant of their ...

Is Palin Invoking Locke’s Right Of Rebellion?
... rebellion against the government of the United States. Having the lost the appeal to the majority of Americans, they will soon be invoking an ...

Autodesk sued for $10 million after invoking DMCA to stop eBay resales
A Seattle man has filed suit against Autodesk, the creators of AutoCAD, for …

Invoking the Coase Theorem for Fracking Noise
From Kevin Williamson's excellent article in National Review " The Truth About Fracking ": "There are other workaday environmental problems ...

How I solved my problem with pushup avoidance by invoking Peter Drucker
Long story short: a couple months ago my son-in-law — listening to me lament how my upper body isn't nearly as strong as it used to be and is ...

Hillary Clinton Defends Ties to Wall Street by Invoking 9/11
Democratic presidential candidate Hillary Clinton defended her ties to Wall Street by invoking the September 11, 2001 terror attack.

Resources last updated: 3/31/2016 4:08:03 AM