matlab

Can MatLab understand Java int datatype?

I have a java.util.HashMap object that I want to convert generally into a MatLab datatype, perhaps the new containers.Map type. Ideally I could do: it = javaHashMapObj.keySet.iterator; while it.hasNext jkey = it.next; someMatlabObj(jkey) = javaHashMapObj.get(jkey); end Among other potential problems (please point out, resolve...

How do I use a Python regex to match the function syntax of MATLAB?

I am trying to find all the inputs/outputs of all MATLAB functions in our internal library. I am new (first time) to regex and have been trying to use the multiline mode in Python's re library. The MATLAB function syntax looks like: function output = func_name(input) where the signature can span multiple lines. I started with a patt...

how to create a very large matrix using matlab

Hello, I have a problem with matlab when I'm trying to create a a matrix with a very large size such as 40000x40000. for example: x=zeros(40000,40000); the error message is "??? Maximum variable size allowed by the program is exceeded. " is there any solution. Also I have another question, can we have a matrix with variable column...

comparing modem.oqpsk probability error and ber

hi currently i have the following code in my matlab values = [0;1;0;0;1;0;1;0]; % can contain only 0s and 1s h = modem.oqpskmod; y = modulate(h, values); g = modem.oqpskdemod(h); z = demodulate(g,y); BER = sum(logical(values(:)-z(:)))/numel(values);% thanks to gnovice! now my question ...

modem.oqpskmod - converting array of different values to array of 1s and 0s

hi i was doing the following in matlab values = [0;1;0;0;1;0;1;0]; % can contain only 0s and 1s h = modem.oqpskmod; y = modulate(h, values); g = modem.oqpskdemod(h); z = demodulate(g,y); BER = sum(logical(values(:)-z(:)))/numel(values); % thanks to gnovice! before calculating the BER, do you think that i...

shared library locations for matlab mex files:

hello; I am trying to write a matlab mex function which uses libhdf5; My Linux install provides libhdf5-1.8 shared libraries and headers. However, my version of Matlab, r2007b, provides a libhdf5.so from the 1.6 release. (Matlab .mat files bootstrap hdf5, evidently). When I compile the mex, it segfaults in Matlab. If I downgrade my vers...

3D Correspondences from fundamental matrix

In MATLAB I have calculated the Fundamental matrix (of two images) using the normalized Eight point algorithm. From that I need to triangulate the corresponding image points in 3D space. From what I understand, to do this I would need the rotation and translation of the image's cameras. The easiest way of course would be calibrate the ca...

How to plot in circle instead of straight line axis in Matlab?

I have a set of 3 datasets which I want to plot in MATLAB, but the 'x' axis, I want to give in the form of a circle instead of of straight bottom line. Any idea on how to do it? An example plot: The normal command for plotting in MATLAB is plot(x, data1, x data2, x, data3), in that the x axis is taken as the straight line. I want the...

MATLAB: Assign multiple colors to text in legend

I'm trying to color code text in a legend. (Since I'm trying to sort several plots into different categories, I can't just rely on the line colors in the legend.) I've managed to set the text color for the entire legend, but I can't manage to assign it line by line. Is this possible? Code so far: list={'Label 1','Label 2','Label 3'}; l...

matlab error using m power

so if I run this function in matlab sim1(row,1:512)= ((image(row,1:512,1)-a(1,1))); it runs fine. now if I modify it to take the square like this sim1(row,1:512)= ((image(row,1:512,1)-a(1,1)))^2; it gives me the error, error using ==> mpower matrix dimensions must agree. Why is this giving me the error, I can do this element by e...

How do you display something from a function onto a display window in a GUI in MATLAB?

I have a function sumsurface that I use in the following code to display certain values in the command window: if sumsurface(i) < .01 && sumsurface(i) > -.01 disp(sumsurface(i)); disp(pH(i)); end However, I instead want to display sumsurface(i) and pH(i) on a display window in a GUI. How can I do this? ...

Performing functions for multiple input values

Hi, I am designing a structural optimisation program as part of my degree, and I need to run a sequence of optimisation code for a number of different structural sections. For each section, a number of different imposed loads will be defined and then the optimum form generated in response to this loading. In programming terms, I nee...

Sliding window algorithm for activiting recognition MATLAB

I want to write a sliding window algorithm for use in activity recognition. The training data is <1xN> so I'm thinking I just need to take (say window_size=3) the window_size of data and train that. I also later want to use this algorithm on a matrix . I'm new to matlab so i need any advice/directions on how to implement this correct...

How do I compare all elements of two arrays in MATLAB?

I have two big arrays with about 1000 rows and 1000 columns. I need to compare each element of these arrays and store 1 in another array if the corresponding elements are equal. I can do this with for loops but that takes a long time. How can I do this faster? ...

Does Mathematica have a function equivalent to Matlab's "unique" function

Is there a Mathematica function that provides results equivalent to the unique() function in MATLAB? I realize I could use the Union[] function to obtain the unique elements of a list, but I would like something equivalent to the three-result version of the function that provides index arrays that map between the input array and the arra...

How do I put variable values into a text string in MATLAB?

I'm trying to write a simple function that takes two inputs, x and y, and passes these to three other simple functions that add, multiply, and divide them. The main function should then display the results as a string containing x, y, and the totals. I think there's something I'm not understanding about output arguments. Anyway, here's ...

matlab neural network coding

how i can classify pnn for feature extraction? ...

How do I load an image file in Matlab?

I have to use Matlab to read a picture and make a joint histogram and I'm new to Matlab. When I try to read the Image by using imread function it does not work. h= imread('a.tif'); ??? Error using ==> imread at 363 File "a.tif" does not exist. Can anyone help me figure out this problem? ...

Call matlab functions in silverlight

Hello, Is it possible to call matlab functions from Silverlight / C# ? Thanks in advance! ...

MATLAB: comparing all elements of two arrays

I have two matrices in MATLAB lets say arr1 and arr2 of size 1000*1000 each. I want to compare their elements and save the comparison in a result matrix resarr which is also 1000*1000 such that for each element: if the element in arr1 is bigger than the one in arr2, place the value 1 in the result if the element in arr2 is bigger, stor...