Answered

Imaginary numbers when solving ode (ode15s)

Hello YF, whenever unexpected complex quantities start appearing, it's time to look for the usual suspects, which tend to be ei...

Imaginary numbers when solving ode (ode15s)

Hello YF, whenever unexpected complex quantities start appearing, it's time to look for the usual suspects, which tend to be ei...

1 day ago | 0

| accepted

Answered

Q Factor is not same

Hello Abdullah be aware that what you are calling alpha is often called alpha/2, but I don't think that had anything to do with...

Q Factor is not same

Hello Abdullah be aware that what you are calling alpha is often called alpha/2, but I don't think that had anything to do with...

2 days ago | 1

| accepted

Answered

How does nanstd function process complex numbers

Hi Luciano I'm not sure what you are referrng to with " nanstd(C) returns a complex matrix with dimentions equal to C and rea...

How does nanstd function process complex numbers

Hi Luciano I'm not sure what you are referrng to with " nanstd(C) returns a complex matrix with dimentions equal to C and rea...

3 days ago | 0

Answered

Power calculation from Voltage and current waveforms

Hi Stefano, The biggest issue is that when using trapz, you have not taken into account the width of the time steps when doing ...

Power calculation from Voltage and current waveforms

Hi Stefano, The biggest issue is that when using trapz, you have not taken into account the width of the time steps when doing ...

3 days ago | 0

Answered

FFT and Parseval's Theorem

Hi Chen, Here are a couple of ways. Since the time function fills up the entire time window (as opposed to being some kind of ...

FFT and Parseval's Theorem

Hi Chen, Here are a couple of ways. Since the time function fills up the entire time window (as opposed to being some kind of ...

6 days ago | 1

Answered

In the sine wave source is the formula that links samples per period and sample time correct? It says: Samples per period = 2*pi / (Frequency * Sample time), but I believe it should be Samples per period = Sample time / Frequency.

Hello Ilaria, I believe it is neither of those. Rather it is what is in the PNG with the 2pi crossed out: samples/period = 1/...

In the sine wave source is the formula that links samples per period and sample time correct? It says: Samples per period = 2*pi / (Frequency * Sample time), but I believe it should be Samples per period = Sample time / Frequency.

Hello Ilaria, I believe it is neither of those. Rather it is what is in the PNG with the 2pi crossed out: samples/period = 1/...

9 days ago | 0

Answered

Need help with this integral ? what is opstruct in integralcalc?

Hello HA I assume N is defined further on up since Matlab was not complaining about that. Try fun_2=@(t)(ones(size(t))*N); a...

Need help with this integral ? what is opstruct in integralcalc?

Hello HA I assume N is defined further on up since Matlab was not complaining about that. Try fun_2=@(t)(ones(size(t))*N); a...

9 days ago | 0

Answered

How to obtain the coordinate of the maximum value in the Cross ambiguity function

Hi John, Not having the phased array system toolbox I don't know how the plot axes are oriented, but I think one of the two pos...

How to obtain the coordinate of the maximum value in the Cross ambiguity function

Hi John, Not having the phased array system toolbox I don't know how the plot axes are oriented, but I think one of the two pos...

9 days ago | 0

Answered

solving ode equation using ode45

Hi nadeeshani, UPDATED ANSWER This is a speculative answer, but perhaps you did not take the square root when you calculated t...

solving ode equation using ode45

Hi nadeeshani, UPDATED ANSWER This is a speculative answer, but perhaps you did not take the square root when you calculated t...

9 days ago | 0

Answered

Why am I only getting partial streamlines.

Hi Boris, the problem is the line sy = sx./sx which creates a vector of ones for sy. Then every streamline originates at the h...

Why am I only getting partial streamlines.

Hi Boris, the problem is the line sy = sx./sx which creates a vector of ones for sy. Then every streamline originates at the h...

11 days ago | 0

Answered

Non-Integer For-Loop

Hi Christopher for h = 0:.1:1 works, although with the interval expressed in floating point, you have to be careful. for ...

Non-Integer For-Loop

Hi Christopher for h = 0:.1:1 works, although with the interval expressed in floating point, you have to be careful. for ...

11 days ago | 1

Answered

Why is dsolve solution halved from real answer?

Hi Miles, One of your conditions is dy/dt = 0 which is iffy, since there is a dirac delta function at the origin and you are no...

Why is dsolve solution halved from real answer?

Hi Miles, One of your conditions is dy/dt = 0 which is iffy, since there is a dirac delta function at the origin and you are no...

13 days ago | 4

Answered

error in computing atanh

Hello Francisco, The imaginary part is i*pi/2, so the two answers are a+i*pi/2 and a-i*pi/2, where a is real. Both answers are...

error in computing atanh

Hello Francisco, The imaginary part is i*pi/2, so the two answers are a+i*pi/2 and a-i*pi/2, where a is real. Both answers are...

15 days ago | 1

| accepted

Answered

Significance of Nyquist frequency and Maximum frequency THD computation for FFT analysis

Hi Alsher, you don't show the horizontal frequency scale but I believe that the very small peaks have spacing 5 Hz, there are 1...

Significance of Nyquist frequency and Maximum frequency THD computation for FFT analysis

Hi Alsher, you don't show the horizontal frequency scale but I believe that the very small peaks have spacing 5 Hz, there are 1...

20 days ago | 0

| accepted

Answered

How to calculate error of trapz() function?

Hi Emil, Although there are uncertainties, you can draw some conclusions by using reasonable assumptions. First, you have to b...

How to calculate error of trapz() function?

Hi Emil, Although there are uncertainties, you can draw some conclusions by using reasonable assumptions. First, you have to b...

21 days ago | 0

Answered

How do I prevent overwriting of matrix elements?

Hi Domantas This is just a provisional answer since I am not sure exactly what you are trying to do, but statements like H(1:...

How do I prevent overwriting of matrix elements?

Hi Domantas This is just a provisional answer since I am not sure exactly what you are trying to do, but statements like H(1:...

23 days ago | 0

| accepted

Answered

How do I use acot(x) as a continuous function in matlab?

Hi Michael, I believe that 1/2 - (1/pi)*atan(x) fills the bill. It's the same as (1/pi)*acot(x) for x>0 and is continuous, w...

How do I use acot(x) as a continuous function in matlab?

Hi Michael, I believe that 1/2 - (1/pi)*atan(x) fills the bill. It's the same as (1/pi)*acot(x) for x>0 and is continuous, w...

24 days ago | 1

| accepted

Answered

3D Plot of particle trajectory in E and B field

Hi Lujain, After setting v = [0 1 1] to provide some initial z velocity, figure(2) plot3(X(:,1),X(:,2),X(:,3)) grid on and ...

3D Plot of particle trajectory in E and B field

Hi Lujain, After setting v = [0 1 1] to provide some initial z velocity, figure(2) plot3(X(:,1),X(:,2),X(:,3)) grid on and ...

25 days ago | 0

| accepted

Answered

How to Find the Rotation Matrix?

Hi ercan, MODIFIED First of all, for a rotation matrix the two known columns have to be an orthonormal pair, meaning that ther...

How to Find the Rotation Matrix?

Hi ercan, MODIFIED First of all, for a rotation matrix the two known columns have to be an orthonormal pair, meaning that ther...

27 days ago | 2

| accepted

Answered

Waveform not staring at origin

Hi SA, If you temporarily set c0 = 0 you obtain a nice trapezoidal wave of amplitude 1 that oscillates about y = 0 and has a me...

Waveform not staring at origin

Hi SA, If you temporarily set c0 = 0 you obtain a nice trapezoidal wave of amplitude 1 that oscillates about y = 0 and has a me...

28 days ago | 0

Answered

How do I find a D matrix that satisfies [K]*inv(M)*[D]==[D]*inv(M)*[K] ?

Hi Ikram, Using N in place of inv(M) for simplicity, you are looking for a D such that K*N*D = D*N*K Let K*N and N*K have eig...

How do I find a D matrix that satisfies [K]*inv(M)*[D]==[D]*inv(M)*[K] ?

Hi Ikram, Using N in place of inv(M) for simplicity, you are looking for a D such that K*N*D = D*N*K Let K*N and N*K have eig...

1 month ago | 0

| accepted

Answered

Is there anyway to calculate the position in coordinates of points using a n*n distance matrix?

Hi Meme, first of all, if all you have are the distances between points, you can translate the all the points together in the 2...

Is there anyway to calculate the position in coordinates of points using a n*n distance matrix?

Hi Meme, first of all, if all you have are the distances between points, you can translate the all the points together in the 2...

1 month ago | 0

Answered

Summation subroutine giving result as NaN (not a number)!

Hi Louis, the basic problem is that in the product calculation you have for l=0:n if (l~=j) && (l~=i) && (l~=m) prod=p...

Summation subroutine giving result as NaN (not a number)!

Hi Louis, the basic problem is that in the product calculation you have for l=0:n if (l~=j) && (l~=i) && (l~=m) prod=p...

1 month ago | 0

| accepted

Answered

Replace diagonals in a matrix

Hi Hasan, here is one way r = rand(7,7) n = size(r,1); m = (n-1)/2; a = (-m:m)-(-m:m)'; r(abs(a)>1)=0 assuming the main...

Replace diagonals in a matrix

Hi Hasan, here is one way r = rand(7,7) n = size(r,1); m = (n-1)/2; a = (-m:m)-(-m:m)'; r(abs(a)>1)=0 assuming the main...

1 month ago | 0

Answered

unitConvert isn't converting to Hz

Hi Henrique. you can get there with u = symunit L = 10*u.uH; C = 10*u.fF; unitConvert(simplify(unitConvert(1/sqrt((L*C)), u...

unitConvert isn't converting to Hz

Hi Henrique. you can get there with u = symunit L = 10*u.uH; C = 10*u.fF; unitConvert(simplify(unitConvert(1/sqrt((L*C)), u...

1 month ago | 0

| accepted

Answered

Optimizing calculation of eigenvectors and eigenvalues

Hi Guiseppi, there is nothing guaranteed about the order of the eigenvalues that are produced by eig. And if you do the first ...

Optimizing calculation of eigenvectors and eigenvalues

Hi Guiseppi, there is nothing guaranteed about the order of the eigenvalues that are produced by eig. And if you do the first ...

1 month ago | 2

| accepted

Answered

Creating Polar mesh in matlab

Hi Reza, % make a rectangular grid of r and theta, % then define x and y in the usual way rr = 0:1:20; thth = (0:.05:1)*2*p...

Creating Polar mesh in matlab

Hi Reza, % make a rectangular grid of r and theta, % then define x and y in the usual way rr = 0:1:20; thth = (0:.05:1)*2*p...

2 months ago | 0

| accepted

Answered

Why when calculating impulse response of a filter (system) I get a “tail” at the end

Hi Yurii, It looks like the 'lowpass' function is doing something unexpected, which causes this. In order to get the transfer ...

Why when calculating impulse response of a filter (system) I get a “tail” at the end

Hi Yurii, It looks like the 'lowpass' function is doing something unexpected, which causes this. In order to get the transfer ...

2 months ago | 0

Answered

Peculiar Result with Solve (Symbolic Math Toolbox) with Three Equations and Three Unknowns. Can Anyone Explain?

Hi Paul, certainly in the first case, [eps/5, 4eps/5,eps] is a solution for any nonzero eps, and if you let eps--> 0 and invo...

Peculiar Result with Solve (Symbolic Math Toolbox) with Three Equations and Three Unknowns. Can Anyone Explain?

Hi Paul, certainly in the first case, [eps/5, 4eps/5,eps] is a solution for any nonzero eps, and if you let eps--> 0 and invo...

2 months ago | 0

Answered

Find the common eigenvectors and eigenvalues between 2 matrices

Hi petit, Eigenvectors calculated by Matlab are normalized, but neither (a) the the overall phase of each one or (b) the order ...

Find the common eigenvectors and eigenvalues between 2 matrices

Hi petit, Eigenvectors calculated by Matlab are normalized, but neither (a) the the overall phase of each one or (b) the order ...

2 months ago | 0

| accepted