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.

23 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
1answer
432 views

Matlab IIR filter implementation

I need to implement the Matlab filter(b,a,x) function in Java. Before I do this, I would like to rewrite the function in Matlab before translating into Java. So far,...
4
votes
0answers
99 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, ...
4
votes
0answers
720 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 ...
4
votes
0answers
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; ...
3
votes
0answers
61 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 ...
3
votes
0answers
93 views

Classifying test data into several classes

The following code is to classify the test data into several classes: ...
3
votes
0answers
97 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 ...
3
votes
1answer
2k 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? ...
2
votes
0answers
3k 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 ...
2
votes
0answers
34 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 ...
2
votes
0answers
86 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 ...
2
votes
0answers
502 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 ...
2
votes
0answers
196 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 ...
2
votes
0answers
117 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 ...
1
vote
0answers
151 views

Matlab and WidowX robot arm communication and control

For a class, we needed to control the WidowX arm from Trossen Robotics from Matlab and get as real-time of a feedback as possible. So I came up with a code for the Arbotix Robot-controller which is ...
1
vote
0answers
964 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 ...
1
vote
0answers
70 views

AABB Intersections with Space Partitions, A Sample Code Performance and Reliability

I have originally written the following Matlab code to find intersection between a set of Axes Aligned Bounding Boxes (AABB) and space partitions (here 8 partitions). I believe it is readable by ...
1
vote
0answers
452 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? ...
1
vote
0answers
64 views

Multi-layered Perceptron

Solution: Generate Training Set ...
1
vote
0answers
57 views

Matlab bins with two features: calculation and plotting

I have the following code in Matlab, which is supposed to do what I asked in this SO question. The idea is to: Divide the temperature deadband of each agent (they are different between agents) into <...
1
vote
0answers
48 views

Iteratively process an identically named file all subdirectories and plot analysis to root directory

This script can successfully go through all of the subdirectories in a root directory, and then process a specific file that exists in all of them and output the file in the root directory as a .png ...
1
vote
0answers
105 views

Simple class container for hdf5 files

I implemented a simple class container for hdf5 files in matlab. The situation is as follows. Measurement data is saved in hdf5 ...
1
vote
0answers
130 views

Why does lu-factorization make my program slower?

I'm trying to calculate the smallest eigenvalue of the matrix A by using the "inverted exponentiation method" (see the code). I manage to find the smallest eigenvalue, but when I try to optimize the ...