Matlab

## Creating 2D Matrix from Vector

I currently have a vector called assignments (ex. [1, 1, 3, 2]) of size NUM_PATCHES. I want to create a 2D matrix feat_vecs of dimensions [NUM_CLUSTERS, NUM_PATCHES] such that the matrix looks like ...

1 answers | 3 mins ago by It's Magic on stackoverflow.com

## Bandpass Filter for 4D image in Matlab

I have implemented in Matlab a bandpass filter for a 4D image (4D matrix). The first three dimensions are spatial dimensions, the last dimension is a temporal one. Here is the code: function ...

## Matlab : Find Peaks of Multiple curves in a single image

There are three curves in this image and I am not able to find the peaks of these three curves. How to go about finding the peaks? Or how to go about splitting this image into three separate curves ...

## matlab animation with multiple layers

I'm using contourf to generate a wave propagation animation. I'm coloring just one range in the matrix for each iteration of the for loop.I'm then animating the generating images as gif. When I add ...

## Matlab - Issue using poisolv with non-constant numerical Neumann Boundary Conditions

I want to solve Poisson's Equation on a rectangular domain using the poisolv function from the Partial Equation toolbox. The equation : Laplacian(u) = -f I have a f1 matrix that represents the ...

## Datenum function in Octave is slow. What can I do?

I'm trying to convert a character vector (200,000 rows) into Matlab serial numbers. The format is '01/07/2015 00:00:59'. This takes an incredibly long time, and online I can only find tips for solving ...

1 answers | 1 hour ago by BallzofFury on stackoverflow.com

## MATLAB efficient histogram look up

I have a large 3-dimensional matrix (on the order of 1000x1000x100) containing values that correspond to a bins in normalized high-resolution histograms. There is one histogram for every index in the ...

## Find rows in matlab table

I'm new to Matlab, sorry for this very simple question. Given a table: >> T = table(['MALE';'MALE';'FEMA';'FEMA';'FEMA'],[38;43;38;40;49],[71;69;64;67;64],[176;163;131;133;119]) T = Var1 ...

2 answers | 1 hour ago by A. K. on stackoverflow.com

## Building mex file (mexgdal) in Visual Studio or Matlab (same errors: LNK2001 unresolved external symbol)?

I am trying to compile mexgdal.c in visual studio 2013 and keep coming across the LNK2001 error for Gdal functions (like GDALOpen, GDALAllRegsiter, GDALGetRasterBand, etc.) I've tried the solutions ...

## Questions regarding reorganizing loops for code's efficiency

Here's the problem Consider the following function: function A = plodding(N,d) for ii = 1:N jj = 1; A(ii,jj) = randn; while abs(A(ii,jj)) < d jj = jj + 1; A(ii,jj) = randn; ...

## MATLAB linear separation of point sets

So I have a set of points V, which are the vertices of a convex polytope, and a separate point p. Basically, I want to check whether p is contained in V. To do so, I set up a linear program that ...

## Parallel computing in Linux - Efficiency

I'm trying to run a code with parfors in a Matlab in Linux. There are two problems. The computer that has Linux is much stronger than the one I have Windows. (12 much stronger cores on the Linux ...

## How do I run MATLAB scripts in parallel (i.e. on multiple cores and without using parfor)?

I am looking for options to run MATLAB scripts I have in parallel without too much hassle. Is there an example or a simple scenario on how to proceed in this case?

## Error when trying to use MEX function

I am trying to compile a MEX function on Matlab R2013a, Linux (Ubuntu 14.04) and when I run the system command, it returns the following message: gcc: error trying to exec 'cc1plus': execvp: Not a ...

## how to port parfor loops on GPU?? how can i make use of NVIDIA GFORCE card 2GB inbuild in my laptop

set(handles.txtOperation,'String','Creating NP List...'); pause(0.001); NP_List = zeros([kv size(covtype2,2)-1]); tic; parfor count=1:kv index = find(idx == count); NP_List(count,:) = ...

## Plotting histogram of a slice of a matrix

I have a matrix amp containing 10 row signals [1*1001]. So the total dimension of my data is [10*1001]. Each row is containing amplitude fluctuations(signal). Now by using plot(f,abs(amp)), I am ...

## MATLAB MEX-file builds successfully but nothing is displayed

I am new here so I will try to expose my issue clearly: I am currently developping a program in MATLAB language that has to load a library to work properly. However, the latter is written in C/C++ (I ...

## Armadillo porting imagesc to save image bitmap from matrix

I have this matlab code to display image object after do super spectrogram (stft, couple plca...) t = z2 *stft_options.hop/stft_options.sr; f = ...

## Construct ternary grid, evaluate a function on the grid and contour plot in Matlab

I need to evaluate a function (say) Fxy = 2*x.^2 +3 *y.^2; on a ternary grid x-range (0 - 1), y-range (0-1) and 1-x-y (0 - 1). I am unable to construct the ternary grid on which I need to evaluate the ...

2 answers | 4 hours ago by jam_27 on stackoverflow.com

## control a wpf from matlab by using a c# dll

i would like to know weather it is possible to control some wpf application written in c# by using a c# dll out of matlab. what i need is the possibility to start the MainWindow and i have to be able ...

1 answers | 5 hours ago by justSomeone on stackoverflow.com

## Number of steps necessary in order to complete an algorithm

So guys, I've already asked a question about how to develop an algorithm here. The reviewed code looks like this: (note that I've put the elements in the vector L all equal in order to maximize the ...

2 answers | 5 hours ago by ale42 on stackoverflow.com

## Does MATLAB have a strip function for strings?

Is there a simple function f such that f(' hello, world! ' ) == 'hello, world!' I can strip out the spaces (or any character for that matter) using regexes, but this seems like applying a hammer to ...

2 answers | 5 hours ago by Derek on stackoverflow.com

## Using interp2 in Matlab with NaN inputs

I have some observational data that is relatively complete, but contains some NaN values, in an matrix in matlab and I want to interpolate them to a more evenly spaced grid using interp2 So, to keep ...

## Vectorization of block consecutive matrixes in a Matrix (M = [N(1);N(2);…;N(n)])

I want to vectorize the following code, but I do not know if this is possible (I added the code and an example set as links below). I have a [n,48] matrix with solutions called 'pop'. A solution 'x' ...

## Creating Bitmap image from array in Matlab

I have an array where each element is of 8 bit(ie 0-255) and I have the Height and Width of image I want to make in Img_height and Img_width. Now I want to create a grayscale Bitmap image out of it in ...

## Plot displays additional line that is not included in data

I would be glad if you help me. I wrote short MATLAB program that only displays measured values from a .csv file. It usually works, but with one dataset it draws one extra line for each data intput. ...

## Fourier transform of multiple rows

I want to take FFT of 10 measurements. That means I have 10 rows in my data with each row having dimension [1*2000]. In the code below, I am doing in a wrong way. Can anybody tell me what mistake I am ...

## Matlab mex -setup' is unable to find the compiler/SDK installed on the computer

I have Matlab 2011a 32 bit installed on a Windows7 64 bit computer. I am getting the following error when trying to set up the default compiler: ****??? Error using ==> mex at 208 Unable to ...

## How to get the intersection volume of two meshes (faces & vertices)?

Do you know how to get the intersection (corresponding) volume/meshes of two polygon meshes consisting of the set of faces and vertices in Matlab?

1 answers | 7 hours ago by Joon An on stackoverflow.com