w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Why does matlab causes terminal std out crash and how do I fix it?
As was pointed out in the comments, the makescript is probably dumping "bad" characters to the terminal. You could prevent this (but possibly lose useful information) by redirecting the output - instead of sending it to the terminal window, you can send it to a file, or even /dev/null ("the great bit bucket in the sky"). The underlying problem, however, is that your makefile is even sending these characters to the terminal in the first place. I would recommend that you pipe the output to a file with something like make > myDump.txt, then examine the resulting file to see what is going on, and where in your makefile the problem is created. It is possible that you will still be getting some output when you do this - that's because by default > redirects stdout only, and not stderr - a

Categories : Matlab

Matlab crash on linux
I don't know about the problem you've encountered, but setting environment variable inside of Matlab is done via setenv function: setenv('KMP_DUPLICATE_LIB_OK', 'TRUE');

Categories : Matlab

mxGetIr makes my Matlab crash
After checking the documentation, I think you may need to call it differently. From there I would guess something like this: mwPointer mxGetIr(pm) mwPointer pm

Categories : Matlab

Matlab Crash in RegressionTree mex file
As long as you're running on a system that meets the published MATLAB system requirements, no MathWorks code should really be giving you a segmentation violation like this - whatever input you are passing into it. Even if you're passing in complete nonsense, it should stop gracefully with a MATLAB error, not a hard fault like this. If you can reproduce the behaviour (in a freshly started MATLAB, nothing else running, with the same inputs each time), contact MathWorks support to either discover whether an aspect of your system is unsupported, or to report a bug.

Categories : Matlab

Matlab debugger show variables after crash
If you use dbstop if error then matlab will stop at the line that causes the error, before it actually causes a crash, keeping all the defined variables in the current (function's) workspace. Another method is error handling using try-catch ME, but that seems overkill in your situation.

Categories : Matlab

Launching Matlab from java ProcessBuilder, Matlab console doesn't appear in Mac OS 10.8
You need to specify that MATLAB is to run with a visible UI by making use of the -desktop flag. I don't believe this is documented. So the command you need to run is matlab -desktop -r "initMatlab;runJavaUI;" I've created a Java library called matlabcontrol that can abstract all of this away from you. It can launch MATLAB while running on Windows, OS X, and Linux and then allow you to interact with MATLAB via eval and feval commands. matlabcontrol's code to launch MATLAB is located in matlabcontrol.RemoteMatlabProxyFactory's createProcess(...) method. If you make use of matlabcontrol as a Java library you won't directly interact with either this class or this method.

Categories : Java

How to use Matlab from JAVA without using the Matlab Compiler
If you have Matlab (but you don't have builderJA) then you can use matlabcontrol for using matlab functions in java.(There might be other alternatives too, but I don't know) If you don't have Matlab at all then you can "create the java version of the matlab function" in some other computer having Matlab and builderJA installed, and use the jar files in your own computer. You only need to have MCR (Matlab Compiler Runtime- Its FREE) installed on your computer. Strickly answering your question: Is there a way to do use Matlab from JAVA, but without the need to have the Matlab Compiler? The answer is: Yes, you can use it. Using matlabcontrol (A java API to interact with Matlab).

Categories : Java

Wifi-Connecting App Crash (Java, Android)
Well did you declare the permission to use ACCESS_WIFI_STATE In the AndroidMainfest.xml which is in the root of your Android Project. Just open this and put it above or below the application tag as such <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

Categories : Java

JNI crash when CallVoidMethod to java function to handler
JNI WARNING: threadid=15 using env from threadid=16 You're sharing a JNIEnv between threads. Don't do that -- JNIEnv is thread-specific. Either use what is passed in as the first argument to native methods called from Java code, or save off the JavaVM in a global and get the the JNIEnv with the GetEnv call. See also the JNI Tips page.

Categories : Android

Java/JNI sudden crash after multiple calls to findViewById
Looking at int __android_log_print(int prio, const char *tag, const char *fmt, ...); So your #define should have two logical parameters: One for the format string, and the remaining ones are the parameters: #define PRINTF(format, ...) ((void)__android_log_print(ANDROID_LOG_INFO, "yaui", format, __VA_ARGS__)) The format string is not really part of the varargs. But from a logical point of view, it is used to detect the number of the expected parameters which follow on the stack.

Categories : Java

Mac Java 7 Crash while getting a tooltip after toggling to 'mirror display' on Mac
I do not have a solution for this exact problem, but perhaps a root cause that helps to find a solution as I had a similar problem. The root cause might be this bug: https://bugs.openjdk.java.net/browse/JDK-8057833 Behind Swing AWT is situated and behind AWT there is a native implementation for the respective operating system (in your case mac os X). The native implementation is called from Java via so called 'native' calls (this is a keyword in Java which 'normal' programmers do not come in contact with). This very problem (CFRelease() called with NULL) can arise since an event/action in the native implementation has a state, that is kept for more than one native call. Unfortunately, the state is reset before Java makes a corresponding release in the objective-c core foundation and ther

Categories : Osx

Java game crash twice on startup without error message
Just copy dlls used in jar to the folder that jar is in.(just put them near jar file) Worked for my jmonkey-jocl benchmark http://forums.guru3d.com/showthread.php?t=379276 you may need an extra .bat file to start jvm with more RAM resource. In the bat file: java -mx2048M -XX:MaxGCPauseMillis=1 -XX:GCPauseIntervalMillis=60000 -XX:ConcGCThreads=2 -XX:ParallelGCThreads=2 -jar physics.jar makes 2GB space for jvm, makes a custom garbage-collection way, runs physics.jar %~p0physics.jar %* rather than just physics.jar makes the addressing more flexible.

Categories : Java

MATLAB java heap space: GUI vs. java.opts
I believe it should do the same thing. Remember that if you change the setting via the MATLAB Preferences dialog, you will need to restart MATLAB for the setting to take effect. I believe that the only difference is that the dialog gives you some (fairly sensible) limits, whereas you can enter anything you like via a java.opts file. You can place the java.opts file either in your startup directory, or in $MATLABROOT/bin/$ARCH, where $MATLABROOT is the MATLAB installation directory and $ARCH is your machine architecture. If you put it there you can start MATLAB in any directory and it will still take effect.

Categories : Java

How can I fix an app crash which is irreproducible? Crash report and console log attached
You error message said: [__NSArrayM objectAtIndex:]: index 0 beyond bounds . The reason probably is that using an NSMUtableArray (__NSArrayM) is not thread safe, see here. Without any code provided, I suggest that you read the Threading Programming Guide cited very carefully, and correct your code accordingly.

Categories : IOS

"java,mathworks" - Matlab Java Exception
The error Subscripted assignment between dissimilar structures generally occurs when you try to do something like the following -- >> s.a = 1; >> s.b = 2; >> t.a = 1; >> s(1) = t // For this to work, s and t must have the same fields ??? Subscripted assignment between dissimilar structures. Check where you're doing a subscripted assignment between structures in your code, and see if the structures you're assigning have the same fields or not.

Categories : Java

C# Application does not crash in VS BUT CRASH on system running
Your program is likely throwing an exception, and it's getting written to the console, but you don't have anything from stopping the console from closing immediately after the message is written. Add a Console.ReadKey(); after your try/catch block.

Categories : C#

Crash while going back from fullscreen video to webview.java.lang.IllegalStateException: You must call removeView() on the child's parent first
First you have to remove you video view mFullScreenViewContainer from parent view and then you can use setContentView() for mWebPageParentView on same parent. Do something like this : ViewGroup parentView = (ViewGroup) mFullScreenViewContainer.getParent(); int index = parentView .indexOfChild(mFullScreenViewContainer); parentView .removeView(mFullScreenViewContainer); parentView .addView(mWebPageParentView); index if want to remove using index. And

Categories : Java

IOS - Unexpected Crash With No Crash Info
You should have some protection around imageFile.getData as it could return nil. You should preferable use the getData: method which returns an error that you can use if the data can't be accessed. NSError *error = nil; NSData *imageData = [imageFile getData:&error]; if (imageData != nil) { imageHolder.image = [UIImage imageWithData:imageData]; } else { NSLog(@"OMG!! %@", error); }

Categories : Iphone

Using Java class in Matlab
Usually I create jar files that contain java classes. I also had problems loading individual java classes before. In your case I did the following on xubuntu 13.04 x64 and Matlab 2013a x64 to load your particular class: Compile it using java 6 (not the default 7) with option -d . to create a set of package folders, as your class defines a package org/j3d/texture/proecedural/ etc: /usr/lib/jvm/java-6-openjdk-amd64/bin/javac -d . PerlinNoiseGenerator.java This will compile the class and make in the current director (thus .) the set of package folders. Make jar file containing your class again using jar from java 6. I named it javaNoise.jar: /usr/lib/jvm/java-6-openjdk-amd64/bin/jar cf javaNoise.jar ./org/j3d/texture/procedural/PerlinNoiseGenerator.class In Matlab, in the directory where

Categories : Java

Switching the java version in MATLAB on OS X 10.8
This problem is fixed with newer releases of Matlab. R2013a, which it looks like you were running, was stuck with the Apple-distributed 1.6 JVM on OS X. Starting with R2013b, Matlab on OS X ships with a bundled JVM like it does on other platforms, and MATLAB_JAVA works now. And the bundled JVM is 1.7. So this issue can be fixed by upgrading to R2013b or later.

Categories : Java

Java code coverage from MATLAB
I haven't actually done it, but this sounds like on-the-fly instrumentation should be doable with the Matlab IDE and JaCoCo. EclEmma is for running things specifically from Eclipse; for Matlab you might want to use JaCoCo on its own even for online analysis. Maybe by using its Java Agent, which you could get Matlab to load into its embedded JVM by supplying a custom java.opts file in your startup directory which includes the -javaagent:... option to load in JaCoCo, described in that linked page. If you stick your Java classes on Matlab's static Java classpath, as opposed to the dynamic one, they'll be loaded through the regular Java system class loaders instead of the custom Matlab one, and should be available to regular Java code coverage tools. Those custom Matlab classloaders are onl

Categories : Java

Why I cannot run this java foo.class file in MATLAB
After you compile the MyQueue2.java , you should get 2 class file MyQueue2.class and MyQueue2$1.class--which is for the anonymous class generated for Comparator , did u put them all in the classpath ? I guess you forgot this.

Categories : Java

Better way to add custom Java classes to Matlab?
You can place the javaaddpath(...) call in a startup.m file that you create and is placed anywhere on your MATLAB path, such as your default start directory. You will not need to call javaaddpath each time you launch MATLAB because a startup.m on your path is automatically called every time. It will not be systemwide unless you happen to place the startup.m in one of the MATLAB system paths. see doc startup Another variation is to use the -r flag and specify an m-file to run on launch that can be named anything. You can modify the Windows shortcut to use this flag, or create an alias if using Linux. Follow the "Specifying Startup Options in the MATLAB Startup File" link from the doc startup page mentioned above for more info.

Categories : Java

webview crash NullPointerException android.webkit.WebViewDatabase.initDatabase(WebViewDatabase.java:234)
Try checking any code that calls android.webkit.WebViewDatabase.initDatabase() Does it have error handling or any problem with opening the database in certain situations? Do you have error handling / object detection? Can you show a few lines of the code?

Categories : Android

Android Crash, java.lang.IllegalArgumentException: Window type can not be changed after the window is added
check Androidmanifest.xml <uses-sdk //************ android:targetSdkVersion="X"/> X must be less than 14 Or remove this attribute. good luck guy.

Categories : Android

Accessing Java object fields in Matlab
Below is an example of using Java reflection to access a private field in a class (borrowed from this post) Take the following Java class (dont forget to make it accessible to MATLAB using javaaddpath): Test.java class Test { private String str; public Test() {} public void setStr(String value) { str = value; } } First lets instantiate the class: >> t = Test() t = Test@62748e >> t.setStr('foo') >> t.str No appropriate method, property, or field str for class Test. Obviously trying to access the private field throws an error. Here is how we can use reflection: >> f = t.getClass().getDeclaredField('str') f = private java.lang.String Test.str >> f.setAccessible(true) >> f.get(t) ans = foo

Categories : Java

settings required to call matlab from java (netbeans ide)
MATLAB runs a Java Virtual Machine, but isn't really a library you can just call from Java code, sadly. I believe the closest you'll be able to come is invoking MATLAB itself programmatically via system calls in your Java. However, numerous alternatives to MATLAB exist that you might be able to use. Examples include Apache Commons Math, Colt and JAMA. See also this question.

Categories : Java

Java: QName for JAXBElement, without namespace or prefix? (Using matlab)
As requested, posting my solution as an answer: UPDATE I solved this. Two things were required: instead of 'blah', i made blah=java.lang.String('blah') something I forget to do for java within matlab. I believe when entering just 'blah' something went wrong in converting matlab string to java string. Secondly, when making the JAXBElement, instead of using an inner_class variable--which was created using classlist = class.getClass.getClasses(); inner_class = classlist(1); i use blah.getClass() (where blah is a variable for a string). this prints out without any qualifications. I realize now this was more of a mashalling question than a QName question. Ask me why any of these are necessary, and I will not have an answer for you :)

Categories : Java

Java functions become undefined inside Matlab class
Citing the documentation of import(): The import function only affects the import list of the function within which it is used. When invoked at the command prompt, import uses the import list for the MATLAB® command environment. If import is used in a script invoked from a function, it affects the import list of the function. If import is used in a script that is invoked from the command prompt, it affects the import list for the command environment. The import list of a function is persistent across calls to that function and is only cleared when the function is cleared. This means, that your method start() will see an empty import list.

Categories : Java

Open matlab figure on Java Swing button click
It would be simplier if you use the matlab GUI (which uses JButton). You can use findjobj to get the JButton object inside the matlab interface for the uicontrol('Style','pushbutton'). But, if you don't want to do so, you could use JMI. This article gives you some information about it. His book may be very useful for you.

Categories : Java

Suspicion of a java memory leak in the decompression of MHA volumes in Matlab
If the files you read are large (their uncompressed version) this does not need to be a memory leak. You can adjust the java heap space matlab uses in the matlab preferences. Usually it is set to a rather small value of 128 MB - increase it and see if the problem persists. To check whether it is a memory leak, simply try something along: for i=1:1000 % adjust loop-number to your needs m = zlib_decompress(...) end If there is a leak, this should error out once your heap space is full again. If not - your memory footprint should stay within certain limits.

Categories : Java

Limit the significant figures in a uitable in Matlab. Data imported from Java
You can set the ColumnFormat property of the uitable to be any string that the format command accepts. For example, if your table has one column you can set the property to {'short g'} (it has to be a cell array, one value per column). Note that although the format command accepts shortg, in some releases of MATLAB the ColumnFormat property only accepts short g with a space (I think this is a bug). If you need a number of significant figure that is not provided by one of the options to the format command, the best solution I've found is to set all the column formats to char, and convert numerical contents to strings myself using the more flexible capabilities of sprintf.

Categories : Java

Java equivalent to Matlab's `eps` or Numpy/Python's `spacing` function (floating-point relative accuracy)
You want java.lang.math.ulp: Returns the size of an ulp of the argument. An ulp of a double value is the positive distance between this floating-point value and the double value next larger in magnitude. Note that for non-NaN x, ulp(-x) == ulp(x) Also, available for floats. Some background on ULPs.

Categories : Java

Matlab: Improper index matrix reference (or outsmarting matlab)
In the latest versions of MATLAB (13a/13b) there's a unit testing framework built in that looks very similar to what you're attempting. Instead of expect(myfibonacci(0)).toBe(0); you would write import matlab.unittest.constraints.IsEqualTo testCase.verifyThat(myfibonacci(0), IsEqualTo(0)) (You could also/instead have assumeThat, assertThat, or fatalAssertThat). If for some reason you wish to implement your own framework, note the small difference in your syntaxes - you have a dot whereas MathWorks have a comma between myfibonacci(0) and the test condition. In MATLAB you can't index into the result of a subscripted expression like that (well, you could, but you would have to overload subsref, and that's a world of pain, trust me). So the way they've done it is to introduce the test

Categories : Matlab

Will Matlab standalone be faster than Matlab from UI for long execution code?
Applications built with MATLAB Compiler should execute at pretty much exactly the same speed as within MATLAB. MATLAB Compiler does not convert your MATLAB code into machine code in the same way as a C compiler does for C. What it does is to archive and encrypt your MATLAB code (note, it properly encrypts it, not just pcodes it as a comment suggests), create a thin executable wrapper and package them together, possibly also with MATLAB Compiler Runtime (MCR). MCR is very similar to MATLAB itself, without a graphical user interface, and is freely redistibutable. When you run the executable, it dearchives and decrypts your MATLAB code and runs it against the MCR. It should run exactly the same, both in terms of results and speed. Very old versions of MATLAB Compiler (pre-version 4.0) work

Categories : Matlab

How to apply a trained Matlab neural network from C++ without call to Matlab?
Of course it is possible - neural networks are clear mathematical models. All you need is a compatible representation, where you have stored: network topology (number of neurons in particuluar layers) network weights (between all neurons) network activation functions (for each neuron) And that's all. The exact solution depends on what matlab library you are using for neural networks. There is a "standard" for prediction models called PMML, which can be loaded by for example Weka libraries. Either way - it is easy operation, so you can also implement it by hand by simply storing all the numbers in the text file and simulating network in the C++ (as the "forward" phase of the neural network is just few lines of code - the training part is the long one).

Categories : C++

MatLab-->csv: Export data to csv file using dlmwrite in Matlab
I think the problem is that you write the names to a file at the local folder and not the other folder. fldr = fullfile('c:','Data_Analysis'); nomFile=fullfile( fldr, 'Test.csv' ); fid=fopen(nomFile,'w'); fprintf(fid,'%s,',names{:}); fprintf(fid,' '); dlmwrite(nomFile,A,'-append'); fclose(fid);

Categories : Matlab

MATLAB - What are the units of Matlab Camera Calibration Toolbox
I know next to nothing about matlabs (not entirely true but i avoid matlab wherever I can, and that would be almost always possible) tracking utilities but here's some general info. Pixel dimension on the sensor has nothing to do with the size of the pixel on screen, or in model space. For all purposes a camera produces a picture that has no meaningful units. A tracking process is unaware of the scale of the scene. (the perspective projection takes care of that). You can re insert a scale by taking 2 tracked points and measuring the distance between those points. This is the solver spaces distance is pretty much arbitrary. Now if you know the real distance between these points you can get a conversion factor. By doing: real distance / solver space distance. There's really now way to kno

Categories : Matlab

Run Matlab executable file with MATLAB Compiler Runtime (MCR)
It simply means that you don't have rights to run PROGRAM. What is the output of the command: ls -l PROGRAM ? Maybe you've compiled this program as a root? Try to change the access using chmod.

Categories : Matlab

MATLAB: checkmark in MATLAB figure with LaTeX interpreter
it's not pretty, but might be good enough: xlabel('$surd$','interpreter','latex') or look here for other things that look like a tick http://detexify.kirelabs.org

Categories : Matlab



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.