Answered

convolution product calculater impulse response

Hi amjad, You have to keep the indices within the bounds set by dx and dh. For the j loop, you can use the line for j=max(1,i...

convolution product calculater impulse response

Hi amjad, You have to keep the indices within the bounds set by dx and dh. For the j loop, you can use the line for j=max(1,i...

3 meses ago | 0

| accepted

Answered

Why is the magnitude spectrum spreaded over certain frequency range instead of line spectrum in FFT?

Hi lekhani, The spread is happening because you don't have a pure, CW, constant-amplitude cosine wave in the time domain. That...

Why is the magnitude spectrum spreaded over certain frequency range instead of line spectrum in FFT?

Hi lekhani, The spread is happening because you don't have a pure, CW, constant-amplitude cosine wave in the time domain. That...

4 meses ago | 0

| accepted

Answered

How to determine the lag angle between two snine wave

Hi Hassan Consider the complex wave exp(i*(w*t+theta)) = cos(w*t+theta) + i*sin(w*t+theta) While it's true that the cos a...

How to determine the lag angle between two snine wave

Hi Hassan Consider the complex wave exp(i*(w*t+theta)) = cos(w*t+theta) + i*sin(w*t+theta) While it's true that the cos a...

4 meses ago | 0

Answered

Yellow Colormap on contour lines

Hello Juan using: doc colormap will bring up all of the preconstructed choices. In this case it looks like 'hot' was used. 'a...

Yellow Colormap on contour lines

Hello Juan using: doc colormap will bring up all of the preconstructed choices. In this case it looks like 'hot' was used. 'a...

4 meses ago | 0

Answered

I am trying to find values of four constants from four equations. Yet the code is unable to give out values

Hi Sahir, you have to load this beam in some manner in order to get nonzero deflection. If all the boundary conditions are set...

I am trying to find values of four constants from four equations. Yet the code is unable to give out values

Hi Sahir, you have to load this beam in some manner in order to get nonzero deflection. If all the boundary conditions are set...

4 meses ago | 0

Answered

What is this fft code doing?

Hi kcee, The code (I'll refer to it by line below) is not doing what it is doing very well. Let's start with the good part, th...

What is this fft code doing?

Hi kcee, The code (I'll refer to it by line below) is not doing what it is doing very well. Let's start with the good part, th...

5 meses ago | 0

Answered

How to approximate a triple integral over a rotated grid?

Hi Oscar, Before the cyinder is tilted, you are describing the volume with cylindrical coordinates and finding the moment of in...

How to approximate a triple integral over a rotated grid?

Hi Oscar, Before the cyinder is tilted, you are describing the volume with cylindrical coordinates and finding the moment of in...

5 meses ago | 0

| accepted

Answered

How to plot the subplots but with less lines of code?

HI muhammed all you need to do is put the subplots into a for loop and change the things that vary with subplot. That is the d...

How to plot the subplots but with less lines of code?

HI muhammed all you need to do is put the subplots into a for loop and change the things that vary with subplot. That is the d...

5 meses ago | 1

| accepted

Answered

I have code which calculates the electric potential due a single charge. The results are concentric circles (Correct results) but don't match the theoretical data

Hi Matthew, probably a bit late to be answering this now, but thanks to some editing done by John Kelly at Mathworks it provide...

I have code which calculates the electric potential due a single charge. The results are concentric circles (Correct results) but don't match the theoretical data

Hi Matthew, probably a bit late to be answering this now, but thanks to some editing done by John Kelly at Mathworks it provide...

5 meses ago | 0

Answered

Huffman Dictionary, error with index exceed when i give specific probabilities.

Hi Rafael, sum(probabilities) ans = 1.0003 SInce the probabilities don't add up to 1, the code is going to have problems. ...

Huffman Dictionary, error with index exceed when i give specific probabilities.

Hi Rafael, sum(probabilities) ans = 1.0003 SInce the probabilities don't add up to 1, the code is going to have problems. ...

5 meses ago | 1

| accepted

Answered

roots of 3*3 matrix determinant

Hi Cern, I assume you mean the three values of w that give a 0 determinant. Eig works for this. K = rand(3,3) c = diag([12 2...

roots of 3*3 matrix determinant

Hi Cern, I assume you mean the three values of w that give a 0 determinant. Eig works for this. K = rand(3,3) c = diag([12 2...

5 meses ago | 0

| accepted

Answered

LDL does not support complex symmetric matrices

Hi Nathan, the LDL decomposition works for hermitian matrices. In LDL the D matrix is hermitian, so if A = L*D*L', then A' ...

LDL does not support complex symmetric matrices

Hi Nathan, the LDL decomposition works for hermitian matrices. In LDL the D matrix is hermitian, so if A = L*D*L', then A' ...

5 meses ago | 1

Answered

fft showing frequency components at double rates

Hi Sina, Here is an observation and a possible answer. If you expand out plot(t,y) (I used xlim([4 4.1]*1e-12) ) there ar...

fft showing frequency components at double rates

Hi Sina, Here is an observation and a possible answer. If you expand out plot(t,y) (I used xlim([4 4.1]*1e-12) ) there ar...

5 meses ago | 0

| accepted

Answered

Solving set of coupled non-linear ode using ode45

Hi Ajai, The angles appear to be measured from the horizontal, not the vertical. That's because the terms involving g use cos(...

Solving set of coupled non-linear ode using ode45

Hi Ajai, The angles appear to be measured from the horizontal, not the vertical. That's because the terms involving g use cos(...

5 meses ago | 0

| accepted

Answered

Energy eigenvalues plot of a Hamiltonian(Weyl)

Hi Vira, The plot has no room for px so I assumed it was zero. px=0 corresponds to E(17,:,:,:). Then everything seems to come...

Energy eigenvalues plot of a Hamiltonian(Weyl)

Hi Vira, The plot has no room for px so I assumed it was zero. px=0 corresponds to E(17,:,:,:). Then everything seems to come...

5 meses ago | 0

| accepted

Answered

when I am subtracting two same values found out from different equations not giving 0, it is giving imaginary value

Hi Bikram, this is all because of precision issues when dealing with floating point numbers. After running your code, tminusx...

when I am subtracting two same values found out from different equations not giving 0, it is giving imaginary value

Hi Bikram, this is all because of precision issues when dealing with floating point numbers. After running your code, tminusx...

5 meses ago | 0

| accepted

Answered

Is there a way I can convert image (pixel) values to Raman shift using MATLAB?

Now that the peaks in both pixels and cm^(-1) are provided, you can do a linear fit, which is very close. p = [155.56834, 396.5...

Is there a way I can convert image (pixel) values to Raman shift using MATLAB?

Now that the peaks in both pixels and cm^(-1) are provided, you can do a linear fit, which is very close. p = [155.56834, 396.5...

5 meses ago | 0

Answered

Why does a sine bandwidth decrease with 1/dur, dur beeing the signal duration

Hi Jonas, I believe what you are seeing is just the natural reciprocal relation between width in the time domain and width in t...

Why does a sine bandwidth decrease with 1/dur, dur beeing the signal duration

Hi Jonas, I believe what you are seeing is just the natural reciprocal relation between width in the time domain and width in t...

5 meses ago | 0

| accepted

Answered

PCA output gives NaN after normalizing input matrix

Hi Christopher, I am not making any comment on the svd procedure, but f = find(all(obs==0)) f = 79 80 81 82 83 ...

PCA output gives NaN after normalizing input matrix

Hi Christopher, I am not making any comment on the svd procedure, but f = find(all(obs==0)) f = 79 80 81 82 83 ...

5 meses ago | 0

| accepted

Answered

How to sort a vector based on the absolute difference of the sorted vector

Hi Awais, a= [2,3,6,12,7,18,25,0,28,5] b = sort(a)' % column vector c = [b(1:end-1) b(2:end)]; d = [diff(c,[],2) ...

How to sort a vector based on the absolute difference of the sorted vector

Hi Awais, a= [2,3,6,12,7,18,25,0,28,5] b = sort(a)' % column vector c = [b(1:end-1) b(2:end)]; d = [diff(c,[],2) ...

5 meses ago | 1

| accepted

Answered

solve equation in Matlab and for loop

Hi Myrto you have a sixth degree polynomial to solve and find the roots. However, there are no algebraic solutions for the roo...

solve equation in Matlab and for loop

Hi Myrto you have a sixth degree polynomial to solve and find the roots. However, there are no algebraic solutions for the roo...

5 meses ago | 0

| accepted

Answered

Hankel function, mathematical definition

Hi Kevin, The hankel functions h that you cited are spherical hankel functions, which have half-integer order and are related t...

Hankel function, mathematical definition

Hi Kevin, The hankel functions h that you cited are spherical hankel functions, which have half-integer order and are related t...

6 meses ago | 1

| accepted

Answered

Different method of calculation the same thing give different values?

Hi Ariwan, The differences here are all down at the level of machine precision. Differences on the order of 1e-16 happen all t...

Different method of calculation the same thing give different values?

Hi Ariwan, The differences here are all down at the level of machine precision. Differences on the order of 1e-16 happen all t...

6 meses ago | 1

| accepted

Answered

How do I plot an FFT of a large data set?

Hi Angelica, One possible reason is that the data has a DC offset, i.e. its mean is not zero. What can happen is that the DC o...

How do I plot an FFT of a large data set?

Hi Angelica, One possible reason is that the data has a DC offset, i.e. its mean is not zero. What can happen is that the DC o...

6 meses ago | 0

| accepted

Answered

fourier transform shifted graphic

Hello MK First of all it is not a good idea to have a variable called 'sum' because that's the name of a basic Matlab function....

fourier transform shifted graphic

Hello MK First of all it is not a good idea to have a variable called 'sum' because that's the name of a basic Matlab function....

6 meses ago | 1

| accepted

Answered

Maximize answer of second order Polynomial inequality

Hi Luuk It makes more sense to find the boundaries of the inequality: syms x eqn1 = 0.99*x^2-99==0; x_num = solve(eqn1, x) ...

Maximize answer of second order Polynomial inequality

Hi Luuk It makes more sense to find the boundaries of the inequality: syms x eqn1 = 0.99*x^2-99==0; x_num = solve(eqn1, x) ...

6 meses ago | 1

| accepted

Answered

Distribute a sum using binomial distribution

Hi Vorticella, In the code you are using, the two numbers are chosen independently and usually don't add up to be the row sum. ...

Distribute a sum using binomial distribution

Hi Vorticella, In the code you are using, the two numbers are chosen independently and usually don't add up to be the row sum. ...

6 meses ago | 0

| accepted

Answered

How to avoid introducing abs( ) when simplifying expressions using the symbolic toolbox ?

Hello Prajwal, norm_v = abs(xdot)/abs(cos(x)) so it does fundamentally depend on abs. Since norm_v is being divided into quan...

How to avoid introducing abs( ) when simplifying expressions using the symbolic toolbox ?

Hello Prajwal, norm_v = abs(xdot)/abs(cos(x)) so it does fundamentally depend on abs. Since norm_v is being divided into quan...

6 meses ago | 0

Answered

Recurrence relation for polynomial indices

Hello Jaime, Suppose you want the results up to a polynomial of degree p. The following code creates a (p+1)x(p+1) matrix c of...

Recurrence relation for polynomial indices

Hello Jaime, Suppose you want the results up to a polynomial of degree p. The following code creates a (p+1)x(p+1) matrix c of...

6 meses ago | 0

| accepted

Answered

How can I represent the sparse mass, damping and stiffness matrices in state space?

HI 'M', Suppose you have n positions and n corresponding velocities. Let the state space (column) vector be in the order y = ...

How can I represent the sparse mass, damping and stiffness matrices in state space?

HI 'M', Suppose you have n positions and n corresponding velocities. Let the state space (column) vector be in the order y = ...

6 meses ago | 0