I'm using a JAR file of my own, which uses a Java library (JHDF5), that in turn uses a dll through JNI. When I use my own JAR file in MATLAB, and then have to rebuild it while debugging, I get this error when I try to use it again, after calling clear java and creating a new object from my JAR file:
java.lang.UnsatisfiedLinkError:
Nati...
I'm wondering how in MATLAB you can get a reference to a Java enum or static public field. In MATLAB, if you are trying to use Java objects/methods, there are equivalents to Java object creation / method call / etc.:
Java: new com.example.test.Foo();
MATLAB: javaObject('com.example.test.Foo');
Java: com.example.test.Foo.staticMethod...
Hey there
I have some Matlab image processing code which runs pretty slowly and I'm prepared to convert it over to C/C++. I don't really know much about how matlab works and how code is executed but I'm just interested to hear what kind of speedups I might expect. Clearly there are many variables that will affect this but I'm just loo...
Hello.
I'm trying to convert an image into an audio signal in MATLAB by treating it as a spectrogram as in Aphex Twin's song on Windowlicker. Unfortunately, I'm having trouble getting a result.
Here it what I have at the moment:
function signal = imagetosignal(path, format)
% Read in the image and make it symmetric.
image = ...
I have a Simulink model that uses an embedded MATLAB function for a block, and I haven't been able to figure out how to move data between the embedded MATLAB block and a GUI in real-time (i.e. while the model is running). I tried to implement a "to workspace" block in my model but I don't know how to correctly use it.
Does anyone know h...
Hi,
I have been given a bit of a strange task, there are around 1500-2000 jpeg images all of around 1-50kb in size. They are currently stored in a simple database I made with Postgres. It's been a long time since I used Matlab and Postgres heavily so any help or suggestions is really appreciated!
I need to get the images that are store...
Hi, I have read the documentation and several websites on exactly how to do this, however Matlab does not seem to pick up the classes that I have added to the dynamic java class path. Nor do I use the right syntax to correctly construct the object.
I have an class HandDB and which to create an object of this type and invoke it's static ...
I am new to MATLAB, it wasn't in the job description and I've been forced to take over for the person who wrote and maintained the code my company uses. Life's tough.
The guy from which I'm taking over told me that he declared all the big data vectors as global, to save memory. More specifically, so that when one function calls another ...
I'm having a problem sending a value from a GUI to an Embedded MATLAB Function (EMF) in a Simulink model. I get this value from a slider in my GUI and send it to an EMF block in my model. I can confirm that the value is being transferred correctly from my GUI to my Simulink block, since I can display the value with a display block in my ...
Hi,
I'm running into a problem that I think is related to updating JAXB to the latest version. I'm running a marshal command that returns:
??? Java exception occurred:
javax.xml.bind.MarshalException
- with linked exception:
[java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String]
at com.sun.xml....
I am looking to do a nested sort with a matrix in MATLAB. Say my matrix looks like this:
[b a;
b c;
a c;
a a]
I would like to first sort by the first column and maintain that sort, then sort by the second column. The result would be:
[a a;
a c;
b a;
b c]
How would it be done?
...
In Matlab when one tries to access an element of a matrix that doesn't exist usually an error is raised:
>> month(0)
??? Subscript indices must either be real positive integers or logicals.
I was wondering whether there is a function that allows supplying default value in such cases. E.g.,:
>> get_def(month(0), NaN)
ans =
NaN
P....
I'm trying to programmatically rename a file in the working directory from a = 'temp.txt' to b = 'hello.txt'. How would you suggest doing so? Is there an easy file renaming function in MATLAB?
...
I would like to have the original string 'black.txt' to be parsed into a = 'black' and ext = '.txt'. Every filename/string is going to have the extension '.txt'. I'm wondering what would be the easiest way of achieving this in Matlab so that I can concatenate the new string appropriately. Thanks in advance.
...
I have just rewritten a Matlab program in c++ as a mex-function to speed things up, with fantastic results. This optimization decision was a very very good idea, with up to a factor 20 speed up without threading. It still left me curious about what the mex-function was spending time on and wanting to identify possible bottlenecks.
I'm ...
When I run a sample script in Matlab, it says:
Out of memory. Type HELP MEMORY for your options.
When I type "memory", it reports:
Maximum possible array: 156 MB (1.638e+008 bytes) *
Memory available for all arrays: 740 MB (7.756e+008 bytes) **
Memory used by MATLAB: 1054 MB (1.105e+009 bytes)
Physical Memo...
In MATLAB I can define multiple functions in one file, with only the first defined function being visible external to that file. Alternatively, I can put each function in its own file and make them all globally visible through the path. I'm writing a menu driven application, where each menu item runs a different function. Currently, thes...
I have a contour plot and I am using the current rendering:
set(gcf, 'renderer', 'zbuffer');
but it is giving me this thick red line in the plot and I don't know how to get rid of it. I tried switching to:
set(gcf, 'renderer', 'opengl');
but the quality is poor and I really need to have high quality images. Any suggestions?
...
Hello
Is there a way in Matlab to find the 4h vertice of a parallelogram when other 3 are known ?
I would like to draw a rotated reactangle with mouse but Matlab doesn't allow it, so I decided to put 3 points and find 4th one automatically and by impoly function draw a
h1=impoint();
h2=impoint();
h3=impoint();
p1 = getPosition(h);
p...
I apologize for being a bit verbose in advance: if you want to skip all the background mumbo jumbo you can see my question down below.
This is pretty much a follow up to a question I previously posted on how to compare two 1D (time dependent) signals. One of the answers I got was to use the cross-correlation function (xcorr in MATLAB), ...