Answered

How to vectorize the following code for matrix insertion?

Hi Jordan, Here is one method. Whether or not it is faster than the for loop method is another question. The code does exactl...

How to vectorize the following code for matrix insertion?

Hi Jordan, Here is one method. Whether or not it is faster than the for loop method is another question. The code does exactl...

2 days ago | 2

Answered

How to obtain the exact value of wavelength from a 2D FFT amplitude vs wavenumber plot like it is obtainable from 1D FFT amplitude vs wavenumber plot?

Hello SB, I am speculating that the issue is the offset from the correct frequencies in the fequency domain plot. The culprit ...

How to obtain the exact value of wavelength from a 2D FFT amplitude vs wavenumber plot like it is obtainable from 1D FFT amplitude vs wavenumber plot?

Hello SB, I am speculating that the issue is the offset from the correct frequencies in the fequency domain plot. The culprit ...

4 days ago | 1

Answered

Why is the radiation pattern does not show the required steering angle?

Hi ZW, In the code below, the key line is s = s + exp((-1j*k*d*(i-1).*sin(angle_1rad(th))) +1j*AF(i)); %equation for field w...

Why is the radiation pattern does not show the required steering angle?

Hi ZW, In the code below, the key line is s = s + exp((-1j*k*d*(i-1).*sin(angle_1rad(th))) +1j*AF(i)); %equation for field w...

6 days ago | 0

| accepted

Answered

Why do these two codes give different covariance matrices?

Hi Sadiq, cov subtracts mean from each column of S, and also divides by (size(S,1) -1). Also S and S' have to be multiplied in...

Why do these two codes give different covariance matrices?

Hi Sadiq, cov subtracts mean from each column of S, and also divides by (size(S,1) -1). Also S and S' have to be multiplied in...

9 days ago | 0

Answered

Mean of the rand function goes against theory

Hi Tarek, the reason that you don't see 0.5 is that you are taking a finite number of samples, 1024, from the distribution. Du...

Mean of the rand function goes against theory

Hi Tarek, the reason that you don't see 0.5 is that you are taking a finite number of samples, 1024, from the distribution. Du...

11 days ago | 1

| accepted

Answered

How can I find an orthogonal vector?

Hello Sue, use null of the transpose of p: syms a p=[1;-a;0] n = null(p.') n = [ a, 0] [ 1, 0] [ 0, 1] and each col...

How can I find an orthogonal vector?

Hello Sue, use null of the transpose of p: syms a p=[1;-a;0] n = null(p.') n = [ a, 0] [ 1, 0] [ 0, 1] and each col...

12 days ago | 1

| accepted

Answered

Generation of a basis vector following a constraint.

Hi Vira, The for loops that you did are a good approach, but like you say this will become impractical as the length of the vec...

Generation of a basis vector following a constraint.

Hi Vira, The for loops that you did are a good approach, but like you say this will become impractical as the length of the vec...

12 days ago | 0

| accepted

Answered

Output of Deconv function Matlab

Hi Aleem, [1 -4] does not divide evenly into [1 -3 -52] so there is a remainder: [a b] = deconv([1 -3 -52],[1 -4]) % b is t...

Output of Deconv function Matlab

Hi Aleem, [1 -4] does not divide evenly into [1 -3 -52] so there is a remainder: [a b] = deconv([1 -3 -52],[1 -4]) % b is t...

13 days ago | 0

Answered

how to create new cumulative frequency array from two existing arrays

Hi BW, mu = 50 sigma = 10 Y = normrnd(mu, sigma, 1,1000); v = linspace(1,1000, 1000); a = cumsum(Y<=v)

how to create new cumulative frequency array from two existing arrays

Hi BW, mu = 50 sigma = 10 Y = normrnd(mu, sigma, 1,1000); v = linspace(1,1000, 1000); a = cumsum(Y<=v)

14 days ago | 0

Answered

Ode45 with 3 non-linear equations

Hi Ahmed, it might be a good idea to go back to the original derivation for this system. Instead of that, you can rewrite this...

Ode45 with 3 non-linear equations

Hi Ahmed, it might be a good idea to go back to the original derivation for this system. Instead of that, you can rewrite this...

16 days ago | 0

Answered

High Resolution fft2 image

The nested for loops use the same variable i, meaning that the outer one doesn't do anything except run through the inner one fi...

High Resolution fft2 image

The nested for loops use the same variable i, meaning that the outer one doesn't do anything except run through the inner one fi...

18 days ago | 0

| accepted

Answered

How can i solve the Error using erfc- Input must be real and full

Hello Siti, Although erfc does not take complex arguments as you know, the kummer U function is available and does take complex...

How can i solve the Error using erfc- Input must be real and full

Hello Siti, Although erfc does not take complex arguments as you know, the kummer U function is available and does take complex...

20 days ago | 1

Answered

Fitting impedance of simple randles circuit to Fourier transform formula

Hi F^2 I believe you are trying to fit an incorrect magnitude, which can of course lead to nonsense. The correct expression is...

Fitting impedance of simple randles circuit to Fourier transform formula

Hi F^2 I believe you are trying to fit an incorrect magnitude, which can of course lead to nonsense. The correct expression is...

24 days ago | 0

Answered

Want to Get Plot To Have Contunuous Angles, Not Stay between -180 and +180 Degrees

Hi Jon, use unwrap(your_data,180) where 180 is just an example and can be anything smaller than the size of the jumps (but no...

Want to Get Plot To Have Contunuous Angles, Not Stay between -180 and +180 Degrees

Hi Jon, use unwrap(your_data,180) where 180 is just an example and can be anything smaller than the size of the jumps (but no...

28 days ago | 1

| accepted

Answered

Issue with getting correct FFT phase plot

Hello SB, the issue here is that the signal window is not the correct width to give the periodicity that you would like. Right...

Issue with getting correct FFT phase plot

Hello SB, the issue here is that the signal window is not the correct width to give the periodicity that you would like. Right...

28 days ago | 0

| accepted

Answered

Permutations of ordered set where only one object changes its position.

Hi Michael, no there is not. CBA is a permutation, and it cannot be made to fit the pattern.

Permutations of ordered set where only one object changes its position.

Hi Michael, no there is not. CBA is a permutation, and it cannot be made to fit the pattern.

29 days ago | 0

| accepted

Answered

ode23, ode45 acting weird - why?

Hi William, Very interesting behavior. Different look but still impressive when the span ends at 40.1. I think the reason may...

ode23, ode45 acting weird - why?

Hi William, Very interesting behavior. Different look but still impressive when the span ends at 40.1. I think the reason may...

29 days ago | 1

| accepted

Answered

Equation for Fourier Series

Hi Romain, increasing the nomber of points is a good idea. I used t=0:0.01*10^(-6):6*10^(-6); but I believe there is also a ...

Equation for Fourier Series

Hi Romain, increasing the nomber of points is a good idea. I used t=0:0.01*10^(-6):6*10^(-6); but I believe there is also a ...

1 month ago | 2

| accepted

Answered

Symbolic solution by matching coefficients in trigonometric equation

Hello Gabriel, here is one way syms id iq x1 y1 th1 th2 eq1 = id*cos(th1) - iq*sin(th1) == 2*x1*cos(th1) - 2*y1*sin(th1) eq2...

Symbolic solution by matching coefficients in trigonometric equation

Hello Gabriel, here is one way syms id iq x1 y1 th1 th2 eq1 = id*cos(th1) - iq*sin(th1) == 2*x1*cos(th1) - 2*y1*sin(th1) eq2...

1 month ago | 0

Answered

optimization using lagrange multipliers

Hi Lal, The problem is that you have V(x,y,z) = x*y*z as a function, but you do not define a fixed value for the volume. The ...

optimization using lagrange multipliers

Hi Lal, The problem is that you have V(x,y,z) = x*y*z as a function, but you do not define a fixed value for the volume. The ...

1 month ago | 1

| accepted

Answered

Problem in performing IFFT

Hi Susmita, A couple of things going on here. First, it's good to use more points. Use a lot more points. There is no need t...

Problem in performing IFFT

Hi Susmita, A couple of things going on here. First, it's good to use more points. Use a lot more points. There is no need t...

1 month ago | 0

| accepted

Answered

Obtaining the envelope of AM signal using hilbert transform

Hi Bernardo, I don't think there is much doubt that the effect is due to a DC offset in the signal. In your figure, both the r...

Obtaining the envelope of AM signal using hilbert transform

Hi Bernardo, I don't think there is much doubt that the effect is due to a DC offset in the signal. In your figure, both the r...

2 months ago | 2

Answered

Inserting new element after each element of an array

Hi Neeraj, not having the communications toolbox I used dec2bin instead, which gives a character array but it is basically the ...

Inserting new element after each element of an array

Hi Neeraj, not having the communications toolbox I used dec2bin instead, which gives a character array but it is basically the ...

2 months ago | 0

Answered

Difference of amplitude after FFT calculation

Hi SO, The y array consists of (supposedly) just one frequency, but aside from the scaling your plot shows spread-out frequency...

Difference of amplitude after FFT calculation

Hi SO, The y array consists of (supposedly) just one frequency, but aside from the scaling your plot shows spread-out frequency...

2 months ago | 0

| accepted

Answered

Natural Cubic Spline interpolation

Hi Bella, you can get the coefficients of the piecewise polynomials for each segment with pp = interp1(x,y,'spline','pp') or ...

Natural Cubic Spline interpolation

Hi Bella, you can get the coefficients of the piecewise polynomials for each segment with pp = interp1(x,y,'spline','pp') or ...

2 months ago | 0

Answered

solving simultaneous equations of fourth order PDE in MATLAB

Hello Devansh Since you have boundary conditions at both x=0 and x=L you can use bvp4c to solve this. But I believe you have t...

solving simultaneous equations of fourth order PDE in MATLAB

Hello Devansh Since you have boundary conditions at both x=0 and x=L you can use bvp4c to solve this. But I believe you have t...

2 months ago | 0

Answered

the final result of laplace transform still contain laplace function?

Hello ZH Matlab doesn't know if taoc is positive or negative. If taoc is negative, the calculation can't really be done. Tha...

the final result of laplace transform still contain laplace function?

Hello ZH Matlab doesn't know if taoc is positive or negative. If taoc is negative, the calculation can't really be done. Tha...

2 months ago | 1

Answered

Help With ODEs Solver(ode45)

Hi Ahmed, repeating the plot command every time in the nested for loops is not helping, For a smaller case (I didn't want to w...

Help With ODEs Solver(ode45)

Hi Ahmed, repeating the plot command every time in the nested for loops is not helping, For a smaller case (I didn't want to w...

2 months ago | 1

| accepted

Answered

Symbolic differentiation of Bessel functions is incorrect

Hi Sam, There is really nothing going on. Both of those identities are correct, as you can check numerically. There are sever...

Symbolic differentiation of Bessel functions is incorrect

Hi Sam, There is really nothing going on. Both of those identities are correct, as you can check numerically. There are sever...

2 months ago | 0

| accepted

Answered

Permutation matrix P in the qr function

Hello Gabriele, I don't think you can conclude anything about the columns of A. That's because the usual qr decomposition is u...

Permutation matrix P in the qr function

Hello Gabriele, I don't think you can conclude anything about the columns of A. That's because the usual qr decomposition is u...

2 months ago | 0

| accepted