Skip to main content

Questions tagged [matlab]

MATLAB is a high-level language and interactive programming environment developed by MathWorks. It is the foundation for a number of other tools, including Simulink and various toolboxes that extend the core capabilities.

24 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
1k views

Two dimensional bicubic interpolation implementation in Matlab

I am attempting to implement two dimensional bicubic interpolation algorithm in Matlab. The input is a two dimensional array and the output is the interpolated result. The test input matrix: ...
JimmyHu's user avatar
  • 5,550
4 votes
0 answers
60 views

Use XYZ data to create cross sectional profiles across beach terrain, using OS Grid

This might be a slightly long question, but I've recently been doing a bit of R&D on the data processing workflows within the company that I work at and it would be great to see if there are any ...
Adam Johns's user avatar
4 votes
0 answers
171 views

Cross-Entropy Minimization - Extreme Code Performance

I'm working on a multivariate cross-entropy minimization model (for more details about it, see this paper, pp. 32-33). It's purpose is to adjust a prior multivariate distribution (in this case, a ...
Tommaso Belluzzo's user avatar
4 votes
0 answers
108 views

Neuroscientific testing

I have written the code below for the following experiment: Subjects get simultaneous stimulation of left and right thumb and have to tell which one was stimulated "stronger" (with higher intensity, ...
Pugl's user avatar
  • 41
4 votes
0 answers
986 views

Reading cell array of vectors with h5py

I have a data stored in .mat files, each .mat contains a cell array of vectors of length ~70. I'm trying to read these .mat files in to Python with h5py, but reading just 1000 cells takes about 7 ...
Jackson's user avatar
  • 183
4 votes
0 answers
2k views

Satellite orbit simulation in Matlab using Runge Kutta 4

I have a satellite orbit simulation in Matlab (Using Runge Kutta 4). It seems ugly and I don't know how to fix it. fx.m file: function v = fx(t,x,vx) v = vx; ...
tanpham's user avatar
  • 41
3 votes
0 answers
37 views

MatLab: Plotting Output Electric Field Spectrum

Goal This code combines two matrices, diagonalizes that matrix, and finds the right and left eigenvectors, right and left eigenvectors are normalized with respect to each other, then it is multiplied ...
Mate's user avatar
  • 31
3 votes
0 answers
68 views

Optimising multiplication of matrix rows with matrix slice/page

I've recently vectorized most of the code for an optimization problem but this one still eludes me. As the procedure and not the actual values are important here, I have replaced the original matrices ...
deemel's user avatar
  • 131
3 votes
0 answers
98 views

Classifying test data into several classes

The following code is to classify the test data into several classes: ...
user avatar
3 votes
1 answer
3k views

fftshift implementation for OpenCV

I'm trying to implement fftshift from matlab for OpenCV. Can you please review the correctness of my algorithm? Have I missed something? Also, is there a better and faster way to do it? ...
Gilad's user avatar
  • 5,273
2 votes
0 answers
38 views

Implementation of calculation of gamma for RBF SVM

I have implemented the calculation of gamma value for RBF SVM as described in Liu et al (2012) [https://ieeexplore.ieee.org/abstract/document/6246300]. Here's a snapshot of the example from the paper: ...
stuckstat's user avatar
  • 129
2 votes
0 answers
4k views

Matlab Code for Convolutional Neural Networks

I am using Matlab to train a convolutional neural network to do a two class image classification problem. I have an imbalanced data set (~1800 images minority class, ~5000 images majority class). As I ...
Alpha Bravo's user avatar
2 votes
0 answers
38 views

Identifying local peaks among some 2D points

The following MATLAB code takes in multiple peak coordinates and heights and eliminates lesser peaks that are within a certain distance threshold of the highest peak of the vicinity. Is there a better ...
Lord Loh.'s user avatar
  • 319
2 votes
0 answers
88 views

Making interpolations in a 4D matrix

I have Matlab code that is very inefficient and I need to run it several times. The code is basically a big parfor loop which I guess there is almost impossible to ...
phdstudent's user avatar
2 votes
0 answers
689 views

Linear interpolation Matlab to C++

I don't have a strong mathematics/Matlab background. I would like to convert this Black level correction function from Matlab to C++. Please comment about on the code style and correctness of my ...
Gilad's user avatar
  • 5,273
2 votes
0 answers
214 views

Kullback-Leibler (KL) distance between inside and outside contour code

I am trying implement the distance measurement between two distributions. The detail is described in here and input image . Let short summarize the idea of the paper: The input image is divided into ...
John's user avatar
  • 121
2 votes
0 answers
120 views

Increasing speed of parity check matrix

The code runs fine and takes 100s to complete it for 5 iteration. I need to reduce it to take less time with the same number of iterations. h = 324 by 648 matrix The code is that of FFT Belief ...
yanen's user avatar
  • 21
2 votes
0 answers
101 views

Fitness function

I have a fitness function, where inputs x1 to x14 have values between 1:4. Is there a way to make this more efficient? Any ...
Mia's user avatar
  • 29
1 vote
0 answers
51 views

Bi-Directional A* function in MATLAB

I am currently working on my thesis for 3D path planning involving external elements, and I have completed about 1/5 of the total trials that I am doing. For each 1/5 of the trials I am increasing the ...
LeftFix's user avatar
  • 11
1 vote
0 answers
88 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 return a ...
JimmyHu's user avatar
  • 5,550
1 vote
0 answers
135 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 ...
JimmyHu's user avatar
  • 5,550
1 vote
0 answers
166 views

Custom Model intended to be used for Curve Fitting. Vectorization vs For Loop and jit numba capabilities

I am new to community and please pardon me if I didn't provide information as intended. This code is supposed to be creating a custom model which will be used with ...
Shankar_Dutt's user avatar
1 vote
0 answers
2k views

Convert Java data to Weka-friendly format without using ARFF

recently I've been working on machine learning with Java and Weka, and while I found the .ARFF format easy to understand (you just need an .ARFF file and Weka will do the rest :P), sometimes the ...
Dang Manh Truong's user avatar
1 vote
0 answers
695 views

Implementation of Multiclass Perceptron

The following text is from Hal Daumé III's "A Course in Machine Learning" online text book (Page-41). I implemented the following: Is the implementation correct? ...
user avatar