matlab

Contour plot when X and Y values are not on a grid

Possible Duplicate: Generate Contour Given X, Y and Z vectors I three vectors X, Y, and Z. Currently, I plot them in a scatter plot, but I want to create a contour plot with them. Can I still do this if X and Y do not form a grid? ...

Mesh plot when X and Y values are not on a grid

Is it possible to create a mesh plot from X, Y, and Z when X and Y do not form a grid? ...

How do I divide the rows of a matrix by different values in MATLAB (array division)

Lets said I have the matrix M = ones(3); and I want to divide each row by a different number, e.g., C = [1;2;3];. 1 1 1 -divide_by-> 1 1 1 1 1 1 1 -divide_by-> 2 = 0.5 0.5 0.5 1 1 1 -divide_by-> 3 0.3 0.3 0.3 How can I do this without using loops? ...

How to use a look up table in MATLAB

I need to perform an exponential operation of two parameters (one set: t, and the other comes from the arrays) on a set of 2D arrays (a 3D Matrix if you want). f(t,x) = exp(t-x) And then I need to add the result of every value in the 3rd dimension. Because it takes too much time using bsxfun to perform the entire operation I was thi...

How do I take a subset of a string in MATLAB

Given a string that represents the name of a person, how do I get the first two characters of this string as a new variable? Is there a function in MATLAB that can do this, or do I need to program it in a MATLAB code file? Jack --> Ja Cleve --> Cl ...

Implementation of parallel coordinates?

I want to implement parallel coordinates for my muldimensional result. Does anyone have a good link to its implementation in matlab or R? Furthermore, are there any suggestions regarding the best tool to use for producing the parallel coordinates? ...

How do I visualize a matrix with colors and values displayed?

I want to create images like this from a double precision matrix using MATLAB. Sample image: http://twitpic.com/2xs943 ...

how to do simple indexing in Matlab cell array

Hi, I've constructed a simple Matlab cell array: d1 = 1 2 3 4 5 d2 = 2 3 4 5 6 d3 = 3 4 5 6 7 d = [5x1 double] [5x1 double] [5x1 double] clear d1 d2 d3; How do I access the original array d1 data inside cell array d, after d1 is cleared? If I do: >> d(1,:) ans = [5x1 double] but what I want to do is issue this ...

Can I Force MATLAB to quit after user presses Control-C?

I'm running MATLAB (command line version) from a shell script, and I'd like it to preserve shell behavior where if you press Ctrl-C it exits. But instead it wants to keep control of the terminal and I (or my poor users after me) have to type quit(1) to make it quit and tell the shell it failed. You can't intercept Ctrl-C with a try/cat...

creating a legend within for loop for Matlab plot

Hi, I want to plot several curves, each having a different length. So, I've placed each curve as an array in a cell index, Y (this allows me to index through arrays of different sizes inside a FOR loop). I use "hold all" below to enable each iteration of the FOR loop to plot each new array in the cell array Y inside the same plot. hold...

What is the difference between .m and .mat files in MATLAB

When I traced my reference MATLAB script, I found files with the .mat extension. My questions are: What is the difference between .mat and .m files? How does one open files with the .mat extension? ...

Plot gradient magnitudes of a colour image in matlab

I would like to plot gradient magnitudes of an color image in matlab. Precisely saying i want the gradient in my x-axis and the log of probability density on my y axis. i would request if someone can help me out. Thanks ...

error Unknown column in 'where clause' matlab using an array of strings

I want to read a column from a table of data base and for every row that I have read, read some rows from another table. the elements that I read from both tables are Strings, my code is: query1 = 'select col1 from MyDb.table1 order by col1'; [x1]= mysql(query1); for i=1:size(x1) my=char(x1(i,1)); query2=spri...

Calculate autocorrelation using FFT in matlab

Hi, I've read some explanations of how autocorrelation can be more efficiently calculated using the fft of a signal, multiplying the real part by the complex conjugate (fourier domain), then using the inverse fft, but I'm having trouble realizing this in matlab because at a detailed level, I don't really know what I'm doing. :o) Any k...

Image Processing via Standalone application

I'm developing a project for doing Content Based Image Retrieval where front end will be in java. The main issue is about choosing tool for performing image processing. Since Matlab provides a lot of functionality for doing CBIR. But the main problem about using Matlab is that you need to have Matlab installed on every computer using th...

How do I get the indexes of specific elements based on value and then replace them in MATLAB?

From the exercises in a book I am using to learn MATLAB: Given x = [3 15 9 12 -1 0 -12 9 6 1], provide the command(s) that will A) set the values of x that are positive to zero B) set values that are multiples of 3 to 3 (rem will help here) C) multiply the values of x that are even by 5 D) extract the values of x that are greater tha...

Matlab vs Aforge vs OpenCV

Hello , I am about to start a project in visual image-processing and have no had experience with Matlab, Aforge, OpenCV and was wondering if anyone had any experiences with these different software packages. I was also wondering which of the three packages were most efficient I assume OpenCV but has anyone had any experience? Thanks ...

How can I efficiently convert a large decimal array into a binary array in MATLAB?

Here's the code I am using now, where decimal1 is an array of decimal values, and B is the number of bits in binary for each value: for (i = 0:1:length(decimal1)-1) out = dec2binvec(decimal1(i+1),B); for (j = 0:B-1) bit_stream(B*i+j+1) = out(B-j); end end The code works, but it takes a long time if the length of th...

How to a convert a date to a number and back again in MATLAB

I have the date 1/11/2010 and use the function = date(year(A1),month(A1),day(A1)) to convert the date to the number to 40189 with Excel. Can I use MATLAB to convert the number 40189 back to the date again? ...

cartoonizing real images

does anybody know we can translate from real image captured using cameras be converted to the cartoon space ? Please note that my goal is not to create animations or the likes, but just to translate to "cartoon colors" if possible. will simple requantization to a space where there is less quantization levels work Or some other specifi...