All Questions
35 questions
6
votes
1
answer
293
views
C++ Eigen/Mex function to perform two pagewise convolutions on a 3D matrix with a simple kernel
I am trying to accelerate an algorithm where I am computing a 2D variance of many complex matrices stored as pages of a 3D array in Matlab. My implementation uses a Mex function with the C++ Matlab ...
1
vote
1
answer
425
views
Calculate distances between two multi-dimensional arrays in Matlab
In question "Dictionary based non-local mean implementation in Matlab", the Manhattan distance between two three-dimensional structures can be calculated by ...
3
votes
1
answer
173
views
Dictionary based non-local mean implementation in Matlab
Given a dictionary including multiple X-Y pairs where X, Y are both three dimensional structure. dictionaryBasedNonlocalMean function returns a ...
3
votes
1
answer
152
views
Three-dimensional DCT spatial frequency components illustration
I am attempting to make three-dimensional discrete cosine transformation spatial frequency components illustration. The 3D cubes is used to present the level of each coefficient. The more bright the ...
4
votes
1
answer
220
views
Parallel 3D Discrete Cosine Transformation Implementation in Matlab
I am trying to implement 3D Discrete Cosine Transformation calculation in Matlab with parallel computing parfor. The formula of 3D Discrete Cosine Transformation is ...
1
vote
1
answer
59
views
GetNeighborhood function for 3D cells structure in MATLAB
I am attempting to implement a GetNeighborhood function in order to get a specific region from inputCells by ...
2
votes
1
answer
812
views
My custom implementation of MATLAB's imdilate
I have been assigned to implement the morphological dilation operation without using MATLAB's imdilate, and I came up with the following solution:
...
4
votes
1
answer
2k
views
Getting saddle points of a matrix
My homework assignment:
Write a function called saddle that finds saddle points in the input matrix M. For the purposes of this problem, a saddle point is defined as an element whose value is ...
2
votes
1
answer
101
views
Applying a function to columns of two matrices producing their combinations
I made a short snippet for applying a function f that takes two arguments (vectors) to columns of two matrices producing all possible combinations of those columns.
...
4
votes
1
answer
493
views
Draw common tangents to two circles interactively in MATLAB
Requirement
After a user draws two circles with their mouse successively, the
program should draw all common tangents, if any, to them.
Here is my implementation
...
4
votes
1
answer
1k
views
Exporting a table with header and subheader
I have an array matrix, for example A(3,3), I want to make a table with header names like, ['force','mass','acceleration'], the second row contains the units (subheader), ['N','Kg','m/s^2'], and the ...
1
vote
1
answer
161
views
Horizontally concatenating the entries of two matrices, and padding with NaNs
I have two matrices a and b that have, on each line, some values (null or not) and then a bunch of zeros at the end.
I want to ...
5
votes
2
answers
118
views
Extract the largest value for each day from a matrix
I have a matrix in which the right-most elements are repeated YYYYMMDD dates in descending order, for example:
...
0
votes
1
answer
88
views
Assign values to a matrix based on the location of non-zero elements in another matrix
I have a matrix, A containing ones and zeros. I want to create a new matrix B where the non-zero elements are in the same ...
1
vote
1
answer
156
views
Merging two square matrices
I would like to optimize a snippet of code, which uses a multiple nested if statements. I am looking for a formula to make it as a combination of multiple arrays ...