matlab

java and matlab Integration

I need to import a plot graph from matlab into java swing GUI? Is there any way to do it? ...

Automatically plot different colored lines in MATLAB

I'm trying to plot several kernel density estimations on the same graph, and I want them to all be different colors. I have a kludged solution using a string 'rgbcmyk' and stepping through it for each separate plot, but I start having duplicates after 7 iterations. Is there an easier/more efficient way to do this, and with more color opt...

How to access elements of matrices from mat file in python?

When load matrices from mat file in python using scipy.io, it makes dictionary where key is name of matrix,and value is 2D array of that matrix. How can i access elements in this array? ...

Problem with the system command in MATLAB

I am using the system command in MATLAB as follows (with the current directory being 'scripts'): [status, result] = system('cd ..\\TxtInOut') However, invoking the system command does not seem to work. It returns status = 0 and result = ''. Any suggestions? ...

Plotting data on time (date) axis in matlab

I have data like this: 22.10.1980. 100 25.10.1980. 120 26.10.1980. 12 (only much more of it, and for each date, several independent measurements on the right). Now, this is probably trivial, but I've never done anything like it in matlab, and am having problems finding similar examples online. I need to plot the data on a time/s...

MATLAB: How to find the image of the line at infinity corresponding to a plane?

There is an image of two separated papers on the floor. How to find the image of the line at infinity corresponding to the plane of the floor? See the image at: (larger) Anyone has some idea on how to start with MATLAB? Thank you, ...

Fastest way to import CSV files in MATLAB

I've written a script that saves its output to a CSV file for later reference, but the second script for importing the data takes an ungainly amount of time to read it back in. The data is in the following format: Item1,val1,val2,val3 Item2,val4,val5,val6,val7 Item3,val8,val9 where the headers are on the left-most column, and the da...

exporting matlab class object (or struct) into java object of similar class using xml

I have similar matlab and java classes: public class myClass { double[][] v1; String v2; } I need to export the matlab object, whos struct is: obj = v1: [2x2 double] v2: 'abc' into Java. Is there a common way to do it? I can also save the struct as xml file. Is there any parser that can do: myClass obj = SomeParser( xmlFile...

Logging function parameters in MATLAB

I'm trying to write a generalised logging function for all the input parameters passed to a function in MATLAB. Is it possible to easily pass all the input parameters to another function without individually naming the parameters? In the logging function, I can of course use inputname(i) in a for loop to get the parameter names. I would ...

Questions on converting a matlab code into a professional software

I am working in MATLAB to write a medical image processing/visualization software that uses MATLAB’s image processing toolbox heavily. My choice of using MATLAB was largely based on availability and my comfort in it and my initial goal was to complete my algorithm and test it. I have largely ignored the GUI part – so I have a software ...

Do I need to escape characters in this MATLAB string?

I would like to call the following bash command in MATLAB: grep "Up to" ~/test_linux/vision1.1/log | awk '{print $7}' I use system() in MATLAB, but it turns out to have errors: >> [status string]=system('grep "Up to" ~/test_linux/vision1.1/log | awk '{print $7}' '); ??? [status string]=system('grep "Up to" ~/test_linux/vision1.1...

Change Directory in MATLAB from Terminal/JAVA

Hi all, I need to be able to change the working directory in MATLAB without interacting with the command window. I'm launching MATLAB from a Java application. Right now the only solution I've come up with is closing MATLAB, changing directory from JAVA and relaunching. Is there some streamlined way to send MATLAB the 'cd' command from J...

Data Classification:sizes of training and test vectors

Hi I have an application which decides whether a human is handwaving,running or walking. The idea is i have segmented an action,say handwave,to its poses. Let's say Example; for human1:pose7-pose3-pose7-..... represents handwave for human3:pose1-pose7-pose1-..... represents handwave for human7:pose1-pose1-pose7-..... represents handwa...

How to automatically spin a 3d hsitogram in matlab?

Hi, I have a 3d histogram in matlab. Is it possible to automatically spin it i.e to get the 3d effects. I want to show it as a video in PowerPoint where the 3d histogram swivels. thanks ...

How to hide zero values in bar3 plot in MATLAB

I've got a 2-D histogram (the plot is 3D - several histograms graphed side by side) that I've generated with the bar3 plot command. However, all the zero values show up as flat squares in the x-y plane. Is there a way I can prevent MATLAB from displaying the values? I already tried replacing all zeros with NaNs, but it didn't change a...

MATLAB's fminsearch function

I have two images I'm trying to co-register - ie, one could be of a ball in the centre of the picture, the other is of the same ball near the edge and I'm trying to find the numbed of pixels I have to move the second image so that the balls would be in the same place. (I'm actually using 3D MRI brain scans, but the principle is the same)...

Matlab - Find point of intersection between two vectors

I have a very simple matlab question. What is the easiest way to find the point of intersection between two vectors. I am not familiar with the various matlab fuctions -- it seems like there should be one for this. For example if I have one vector from (0,0) to (6,6) and another vector from (0,6) to (6,0), I need to determine that they ...

Adaptive Thresholding

I'm trying to implement the following method in Matlab: Minimum Error Thresholding - By J. Kittler and J. Illingworth You may have a look at the PDF: http://liama.ia.ac.cn/wiki/_media/projects:pal:kittler1986.pdf?id=projects%3Apal%3Areadinggroup&cache=cache http://docs.google.com/viewer?a=v&q=cache:XBuTPelQ3pMJ:www.ee.umanitob...

Matlab implementation of Haar feature extraction

Does anyone know of a (purely) matlab implementation of Haar feature extraction (the kind used in Viola&Jones object detection algorithm)? (I ran across a matlab binding to Opencv's implementation but this is not what I am looking for) ...

How would one check for installed MATLAB toolboxes in a script/function?

How would one check for installed MATLAB toolboxes in a script/function? (checking toolbox versions would also be good!) This could provide a quick and useful error message when someone attempts to run a script without a required toolbox. A quick, albeit rough, solution that comes to mind is parsing the text output of the ver command....