matlab questions

matlab questions

• All Sites

## Matlab: colored quiver3 plot

I want to color the quiver3 plot from matlab with the vector magnitude. Is there any way to do that? I saw few codes online which does this for 2d quiver but not for 3d.I'm plotting following and want ...

2 answers | 4 mins ago by Pranav on stackoverflow.com

## imfilter (MatLab) vs ndimage.filters.convolve (Python)

I'm using these two functions in my project: MatLab: imfilter(u,h,'symmetric') Python: ndimage.filters.convolve(u,h,mode= 'mirror') I don't get the same result in both languages for the same image ...

## How can I analyse signal with discrete wavelet transform?

With CWT it's clear enough. We have function of two variables which are scale and translation. But what about DWT? Here is Matlab code: x = 0:pi/100:3*pi; y = sin(x); [lHaar, hHaar] = dwt(y, ...

## How can I insert bytes in the middle of binary file

Is there any way to insert data into file between remaining data? Let's say, I have a vector written in file: [1 5 10 12 15] etc. I would like to insert another vector [2 3 4] between 1 and 5. The ...

## Calculation of cosine in frequency domain instead of calculatin in time-domain followed by a FFT

I got an $N$, in my case 512, point FFT of a real-valued signal. Based on some calculation in my application I determine the parameters $k \in [1, N-1]$, the number of oscillations per period, \$\phi ...

## Error using mex LINK : fatal error LNK1104: cannot open file 'libboost_date_time-vc140-mt-1_60.lib'

I wrote a simple cpp program (1 source file) in VS2015 that uses some boost libraries. The program compiles and runs just fine in VS. I am trying to create a mex file in Matlab so that I can run the ...

## Problem with Generalized Cross Correlation (PHAT filter)

I have to calculate time delay between two signals.I am using the GCC-PHAT method. First, I cut the signals into smaller parts (~0.5s) and then try to calculate the delay. When I display those two ...

## Fit a curve to a discontinuous damped sine in matlab

I got some measurement data, which describes a damped sine. In the picture you can see the measurement (blue), the part I'd like to integrate (red) and a badly fitted curve using polyfit (green). ...

## Extracting down left corner in image in MATLAB

I got an binary image and i want to get the points of the left down corner of this photo: (the one where the red arrow points). In particular, i want to get the coordinates of that point. EDIT: ...

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

## Angle between two vectors matlab

I want to calculate the angle between 2 vectors V = [Vx Vy Vz] and B = [Bx By Bz]. is this formula correct? VdotB = (Vx*Bx + Vy*By + Vz*Bz) Angle = acosd (VdotB / norm(V)*norm(B)) and is there ...

4 answers | 1 hour ago by Jack_111 on stackoverflow.com

## How to Divide Area on Binary Image [Matlab

I'm Dewi. I have a binary area with centroid. this is the image image with centroid I want to ask how to connect this centroid with this coordinats point. 1 1 113 331 241 204 ...

## Creating a Naka Rushton filter for images

I am new to computer vision, and looking at implementing a Naka Rushton filter for contrast enhancement (in Matlab). I tried a simple system where I just use the image as the set of contrasts, and ...

## MATLAB: The determinant of a covariance matrix is either 0 or inf

I have a 1500x1500 covariance matrix of which I am trying to calculate the determinant for EM-ML method. The covariance matrix is obtained by finding the SIGMA matrix and then passing it into the ...

## How to use kmeans function on data stored using datastore function?

I'm trying to cluster big data using kmeans, i found a code that can do something similar here you are Mu = bsxfun(@times,ones(20,30),(1:20)'); % Gaussian mixture mean rn30 = randn(30,30); Sigma = ...

## How can i get Audio Stream input as binary number for AES encryption in verilog?

I am doing a project in which I have written the code for AES-128 encryption algorithm in Verilog with a fixed input (128-bit), Now I want to take audio stream as binary number and use it for input to ...

## Pass Theano / Tensorflow tensor variables to Matlab function from python script

For some research purpose I have to call mpegwrite() function of Matlab from some intermediate step of convolution neural network. I am using Theano and I need to call Matlab function from python ...

## Plotting normals (quivers) with individual color

I have a matrix of normals N at their corresponding locations L, for example calculated by the function pcnormals. I can now plot the normals at their location using the quiver3 function. This all ...

## Why is MATLAB sensitive to order of elements in a struct array assignment?

First I specify A as a struct, and two other structs: B having the same order of elements, and C having a different order of elements. A.x = 11; A.y = 11; B.x = 21; B.y = 22; C.y = 31; %// Note ...

2 answers | 2 hours ago by MGA on stackoverflow.com

## How to remove extra duplicated elements in each row of a matrix in matlab?

Let's say I have a matrix A = [2 3 2 5 6 7 2; 1 2 5 4 5 6 7; 7 5 3 9 8 1 2]; How do I remove 2s and keep one 2 in the first row and keep only one 5 in the second row?

## Converting Hounsfield images to gray scale in matlab

I have Dicom images in matlab which are in HU units, I need it to be in gray scale values, i.e. pixels' values vary from 0 to 255 .. now in HU it vary from -2000 to 4095 .. how can I do that ?

## Linprog error-Matlab

I just tried to solve a simple linear programming problem using matlab, It is pretty easy: Find x that minimizes f(x) = –5x1 – 4x2 –6x3, subject to x1 – x2 + x3 ≤ 20 3x1 + 2x2 + 4x3 ≤ 42 3x1 + 2x2 ...

## Writing an exact equation for Matlab differential equation

I'm having trouble writing an exact equation for this matlab differential problem. I'm using the Forward Euler, Backward Euler, and Crank-Nicolson method. A friend hinted as to how to write the exact ...

## Speed improvement of 2d numerical integration nested for loop in Matlab

I need to call the following function many times during a numerical optimization procedure and would like to increase performance. Here are some thoughts: Profiling the code shows that almost all ...

## compute number of step for composite simpson's rule in matlab

I want to compute the number of step size for my composite simpson's rule in matlab .. Here is my code % Estimate the number of steps n required for the three point composite Simpson’s rule, % ...

2 answers | 3 hours ago by Allie Als on stackoverflow.com

## Program to open .fig files saved by Matlab

Is there any program able to open .fig files saved by Matlab?

4 answers | 3 hours ago by Cleiton on stackoverflow.com

## How to display a matrix of tuples in MATLAB command window?

For example, if: a = ones(2); b = zeros(2); I need something like display('(%d,%d)', a, b) that displays: (1,0) (1,0) (1,0) (1,0) I can do it using for loops, but I need some single-line code.

1 answers | 3 hours ago by saastn on stackoverflow.com

## Matlab Coder throws mixed field type error in structure array while loading MAT file with coder.load

I'm working on a MATLAB Coder project where I want to load some constant values. After trying many possibilities, all unsuccessfully, I came up with the "coder.load" directive that loads variables ...

1 answers | 3 hours ago stackoverflow.com

## Fastest way to compute dsitance between a list of pair of points

I have n points that are in k dimensional space (n by k matrix of data points). In addition, I have a list of pair of points that has length d (dimension of the list matrix is d by 2). My goal is to ...

1 answers | 3 hours ago by questioner on stackoverflow.com

## Find peaks in the data set for 2 different events

I have a data set that contains time and acceleration values. I want to identify regions of acceleration and deceleration, and then return the peak acceleration/deceleration values and associated time ...

1 answers | 3 hours ago by DashD on stackoverflow.com