f



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       
0
10/7/2009 5:27:01 AM
comp.soft-sys.matlab 211266 articles. 23 followers. lunamoonmoon (257) is leader. Post Follow

1 Replies
1285 Views

Similar Articles

[PageSpeed] 50

hi,
did you solve the problem?

MWCellArray Rulelist_Jtable=new MWCellArray(49,3);
for (int i=0;i<val.length;i++){
                                for (int j=0;j<val.length;j++){
                                        Rulelist_Jtable.set({i,j},val[j]);
                                }
                        }  

Myeclipse points out that the method set(int[],Object) is of wrong using with the parameter 'Object'.     
0
Pengfei
9/20/2016 6:58:03 AM
Reply:

Similar Artilces:

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

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

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

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

JA Builder, run Matlab code in java
I have written an application in Matlab and compiled it into Java code using the JA builder. I'm really stuck from here as to how to integrate it into my application. How do I handle data type conversion, call the functions, etc. The algorithm that I wrote in Matlab is for image processing, how can I pass a java buffered image to that function? "Rebecca" wrote in message <ihpamb$acv$1@fred.mathworks.com>... > I have written an application in Matlab and compiled it into Java code using the JA builder. I'm really stuck from here as to how to integrate it into my ...

Builder JA java classes cannot be loaded in Matlab
Hi This maybe sounds a little bit weird, but I'd like to use java components which themselves call Matlab Builder JA classes from within MATLAB. So... 1. Write .m code and compile it with the Builder JA 2. Write java code, which uses the JA classes 3. use the whole framework from MATLAB This approach would represent a very flexible framework for our data analysis, with data analysis, visualization and speed optimizations on both sides (JAVA/MATLAB). Up to know the framework works well if I stay on the java side and use the Builder JA components from within java. In MATLAB I can...

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

Calling Matlab in C in Matlab
Hi everybody! My problem can be described as follows. I have a tool in Matlab that requires calling an optimisation algorithm in C. This algorithm consists of several C-files, one of which contains the function to be minimised (CFUNCTION), and another is the main algorithm file (CMAIN). Now what I want to do is to call Matlab from CFUNCTION or CMAIN and specify my custom function (MFUNCTION) to be minimised. So, I'm calling Matlab from C from Matlab. I'm a newbie in C and MEX files. Should I rewrite CMAIN as a MEX file and include CFUNCTION in this and then use mxCallMATLAB? Or can...

How to access COM objects in MATLAB built with MATLAB Builder NE?
I used the MATLAB R2010b Builder NE to compile a COM-DLL (a single class with a single method) and intend to call the method from within MATLAB R2007b. I cannot distribute m-files or p-files because my code uses new object oriented features introduced in R2008a. So the idea is to install Matlab Compiler Runtime 2010b on the target machine in addition to MATLAB 2007 and access the function from a DLL. Unfortunately, I was not able to run the method from within MATLAB and could not find any documentation on how to use MATLAB to "test" COM DLLs (or even .NET DLLs or C-DLLs) built with the MATLAB Compiler. The documentation yet is very clear on how to use external interfaces, e.g using actxserver() for COM DLLs, or NET.addAssembly() for .NET DLLs or loadlibrary() for C-DLLs. Since I have no installation of R2007 right now I did everything in R2010 (compiling and testing). Here is what I tried for COM DLLs: >> p = actxserver('myComponent.myClass'); >> p.myMethod(0,[],[]) ??? Invoke Error, Dispatch Exception: Source: myComponent.myClass.1_0 Description: MCR instance is not available and for .NET DLLs: NET.addAssembly(fullfile(cd,'myComponent.dll'); >> p = myComponent.myClass(); ??? Message: The type initializer for "myComponent.myClass" threw an exception. Source: mscorlib HelpLink: and for C-DLLs >> loadlibrary('myComponent.dll','myComponent.h'); Warning: Warnings messages were ...

Matlab plots outside Matlab
I'm making an end-user application where I would like to use Matlab functionality both for calculation and plotting. Matlabs GUI builder guide does not satisfy my needs (no support for f.ex. internal frames and other nescessities), so I'm planning to compile my Matlab code and use other API (Java, QT or something) for GUI. My problem is then, that I loose access to the neat plotting commands availible under matlab GUI... Is there a way of integrating Matlabs plot functionality into another GUI system? - has it been done? - I appreciate any response! - P�l Berge ...

parallel matlab
Hi all, I'm going to work on a project involving a parallel version of MATLAB - I'm aware of various efforts like MATLAB-*P and so on Right now I need to read up on some material regarding MATLAB internals eg: How are the ATLAS(or is it BLAS) routines called in MATLAB? How does MATLAB's C code store information in memory, cache'ing etc? How is one to get at those? Do you know of any suitable reference(s)/resource(s)? Thank you very much, Aravind ...

Calling Compiled MATLAB from MATLAB
Hello everyone, How do I compile MATLAB M files into a form that can then be called from within the MATLAB interpreter? A roundabout way would seem to be to (somehow) Turn the matlab code into C (I think mcc does this), then compile this C code into MEX format and call that. Is there an easier way? I have the MATLAB compiler, so I just need to know what to do with it to get this to work. Thanks in advance, Sina sina.tootoonian wrote: > > > Hello everyone, > > How do I compile MATLAB M files into a form that can then be called > from within the MATLAB interpreter? A roundabout way would seem to > be > to (somehow) Turn the matlab code into C (I think mcc does this), > then > compile this C code into MEX format and call that. Is there an > easier > way? I have the MATLAB compiler, so I just need to know what to do > with > it to get this to work. > > Thanks in advance, > > Sina > > HELP MEX > HELP MEX Or, better, HELP MCC help pcode pseudo code is useful to obfuscate code - protect algorithms, yet still run at full speed and be distributable to other matlab users sina.tootoonian wrote: > > > Hello everyone, > > How do I compile MATLAB M files into a form that can then be called > from within the MATLAB interpreter? A roundabout way would seem to > be > to (somehow) Turn the matlab code into C (I think mcc does this), > then > compile this C code into MEX format and call that...

MATLAB JA builder
Dear Guys, Greetings!!! I was trying to build Java Package using MATLAB JA builder; at the end MATLAB Build Failed... the error is... "The system cannot find the path specified Error: An error occurred while shelling out to javac (error code = 1) Unable to build executable" Please help me to fix this error; your help would be much appreciated! Thanks in advance --Ramas ...

Matlab Java Builder
Hello all ,,, I want to ask if someone have tried using the Matlab Java Builder tool box ? I m using this tool box , and trying to run the magic box example, but its giving me problems in creating classes during compiling. the source code given in the example ( Java code) has a class called magic (in line 29) but this class is not created by matlab Java Builder, anyone has an idea how to solve this delima ? thanking you all Anas ...

MATLAB Builder for Java
I tried to follow the 'Magic Square Example' but I got such error. My matlab version is R2007b,JDK version is jdk1.6.0_03 jdk1.5.0_08(either got the same error) Any reply to yekai@itechs.iscas.ac.cn is appreciated! thx! <BASE href=''><font color=black>Build output( 2008-01-07 19:26:14).<p/><p/><a href="matlab:mcc -F 'E:\MATLAB\javabuilder_examples\magic_square\magicsquare.prj'">mcc -F 'E:\MATLAB\javabuilder_examples\magic_square\magicsquare.prj'</a><p/><p/></font> <p><font color=red&g...

matlabrc error after building java component using Matlab Builder JA
I am new to using Matlab Builder JA toolbox. I tried to learn using it by running sample java applications from its help. I implemented the procedure given in its help, builded the java component and then compiled it in command prompt without any error. But when I tried to run the application using java command in command prompt i get an error: ??? Undefined function or variable 'matlabrc'. Exception: com.mathworks.toolbox.javabuilder.MWException : An error occured while initializing the component. I got the same error even for the running the spectral analysis example but before...

Matlab Builder for Java?
Some time ago I came across a Matlab Webinar titled :"Deployment of Matlab Applications to C/C++ COM and Java" where mention was made about the "Matlab Builder for Java" product (or option?). If I got it right this Builder would be something to appear in a following release of the Matlab Builder (formerly Compiler). So, the question is: where is it? Is it included in R14? Is it a dead project? It would be great if someone from TMW could share some info on this subject.. Apparently many people's projects could be simplified if this product was available (or was to become...

matlab
any one please can help me sploving the following question 1________Given the causal system y[n] =3D 0.9y[n-1] + x[n], find H(z) and sketch the pole-zero plot. See the functions roots.m and zplane.m. 2___ Plot the magnitude and phase of H(z) on the frequency axis from 0 =E2=80=93 =EF=81=B0, or normalized frequency 0 - 1, and label the graphs. S= ee the freqz.m command. hani_al_yazidi@hotmail.com wrote: > any one please can help me sploving the following question > > > 1________Given the causal system > > y[n] = 0.9y[n-1] + x[n], > > find H(z) and sketch the pole-zero plot. See the functions roots.m and > zplane.m. > > 2___ Plot the magnitude and phase of H(z) on the frequency axis from 0 > – , or normalized frequency 0 - 1, and label the graphs. See the > freqz.m command. It looks like homework. State what you tried and what error messages you got and someone who knows Matlab will probably help. We try not to do homework here, but (like gods) we do help those who help themselves. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯&...

Matlab
Hello , I'm a new user in Matlab. So should you advise matlab notes , documentation please ? <azatserver113@gmail.com> wrote in message news:7b4e75e2-40c6-43bb-acc6-2553123ba649@googlegroups.com... > Hello , > > I'm a new user in Matlab. So should you advise matlab notes , > documentation please ? > At the MATLAB command prompt type this command: doc This will show the documentation included as part of your installation. I recommend reading through the Getting Started section of the MATLAB documentation first, and executing the examp...

how to handle multilple return values from a matlab function in java (using JA builder)
Hi, I wanted to know how to handle multilple return values from a matlab function in java using JA builder, thanks, best regards Fahad Fahad, Wrap each return value into a java object and then pass them into any java method should do the trick. Ed. ...

Web resources about - Matlab builder JA: parse java string to matlab cell - comp.soft-sys.matlab

Associated Builders and Contractors - Wikipedia, the free encyclopedia
^ "ABC Strategic Partnership - Maxwell Systems" . Maxwell Systems, Inc . Retrieved July 10, 2013 . Text is available under the Creative Commons ...

Cheezburger Builder Turns Facebook Photos Into Memes
... the Internet love using Cheezburger to turn photos into memes , but now users can connect their Facebook accounts into the Cheezburger Builder ...

JetSet Secrets, MeuChip, Cinemagram, Jurassic Park Builder and more on this week’s emerging Facebook ...
... Deluxe 790,000 +90,000 + 13% 10. High 5 Casino 318,775 +81,001 + 34% 11. Talkatone 240,000 +80,000 + 50% 12. Jurassic Park Builder ...

Dream Builders (@NBCDreamBuilder) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Business Builders Community
Business Builders is a group for professionals who are business and entrepreneur minded who understand the power and value of networking to grow ...

Retro Car Builder 3D Free - Custom Body Shop and Classic Car Cruiser for iPhone 3GS, iPhone 4, iPhone ...
Get Retro Car Builder 3D Free - Custom Body Shop and Classic Car Cruiser on the App Store. See screenshots and ratings, and read customer reviews. ...

How to avoid dodgy builders
NSW Fair Trading offers some tips and things to look out for to avoid being scammed by shonky builders.

Grossly negligent builder fined $65,000 and banned
Substandard and &quot;hazardous&quot; work on 69 homes lead to builder's registration being stripped for three years.

Scissor lifts banned as RAH builders resume work
WORKERS at the new Royal Adelaide Hospital will return today but will stop using scissor lifts after the death of a grandfather in a second industrial ...

Dodgy Sydney builder Paul Logan ordered to pay $90,475 for fleecing customers
Mark carried out a quick licence check for Sydney builder Paul Logan before paying him thousands to carry out work in his new North Bondi home. ...

Resources last updated: 3/14/2016 8:47:52 AM