Answered

Using 'solve' on a vector of line equations?

Hi Jonathan, It's not totally clear if the geometry is such that there is a separate t value for each row of the hits{1} and hi...

Using 'solve' on a vector of line equations?

Hi Jonathan, It's not totally clear if the geometry is such that there is a separate t value for each row of the hits{1} and hi...

7 hours ago | 0

Answered

Calculating the contributing terms of a summation equation

Hi Bharath, suppose the sum involving q is done over a dummy index j instead of i. It appears that Y and y are vectors of the ...

Calculating the contributing terms of a summation equation

Hi Bharath, suppose the sum involving q is done over a dummy index j instead of i. It appears that Y and y are vectors of the ...

3 days ago | 0

Answered

use the previous result of a function in the calculation

Hi Matthew, there is definitely a better way. Y = filter(B,[1 -A],X) Here the assumption is that X is an input vector and B i...

use the previous result of a function in the calculation

Hi Matthew, there is definitely a better way. Y = filter(B,[1 -A],X) Here the assumption is that X is an input vector and B i...

6 days ago | 0

Answered

Plotting Fourier series from fft output / how to obtain fundamental freq.

Hi Morgan, In this situation with periodic waves, the ftt is divided by L, as you have. The fft is at heart an operation using...

Plotting Fourier series from fft output / how to obtain fundamental freq.

Hi Morgan, In this situation with periodic waves, the ftt is divided by L, as you have. The fft is at heart an operation using...

11 days ago | 0

Answered

quintuple summation using a for loop

Hello Wyatt, The sum comes out zero because it is, in fact, zero. Each term in the desired sum is ((-1)^(iw+jw+k+l+p+q))*con...

quintuple summation using a for loop

Hello Wyatt, The sum comes out zero because it is, in fact, zero. Each term in the desired sum is ((-1)^(iw+jw+k+l+p+q))*con...

14 days ago | 0

Answered

PSD from Wiener Khintchine and FFT

Hi Jan-Niklas It's easier done with convolution instead of correlatation, so convolution is first here. fft does circular conv...

PSD from Wiener Khintchine and FFT

Hi Jan-Niklas It's easier done with convolution instead of correlatation, so convolution is first here. fft does circular conv...

19 days ago | 0

Answered

Why the coordinate doesn't make sense after rotation matrix (rotx)?

Hi Jiali, from your results it looks like you are using the usual form of the rotation matrices, function M = Rx(theta) % an...

Why the coordinate doesn't make sense after rotation matrix (rotx)?

Hi Jiali, from your results it looks like you are using the usual form of the rotation matrices, function M = Rx(theta) % an...

20 days ago | 0

| accepted

Answered

differential equation with mixed linear and log derivatives - proper setting

Hi Patrezio, d(log(x)) = dx/x, and you can insert that result in three locations to obtain eq1 = x*diff( log(y), x) + x*diff( ...

differential equation with mixed linear and log derivatives - proper setting

Hi Patrezio, d(log(x)) = dx/x, and you can insert that result in three locations to obtain eq1 = x*diff( log(y), x) + x*diff( ...

21 days ago | 1

Answered

Are there any built-in way to calculate inversions?

Hi Ivor, I do not know of one, but here is one way to accomplish it p = [3 6 1 4 5 2]; % for example inversions = 0; for...

Are there any built-in way to calculate inversions?

Hi Ivor, I do not know of one, but here is one way to accomplish it p = [3 6 1 4 5 2]; % for example inversions = 0; for...

21 days ago | 0

| accepted

Answered

convolution with gaussian kernel using fft

Hi LM The code below takes your approach but modifies some of the details. [1] The array sizes are odd x odd since you get th...

convolution with gaussian kernel using fft

Hi LM The code below takes your approach but modifies some of the details. [1] The array sizes are odd x odd since you get th...

24 days ago | 1

| accepted

Answered

I have 744 hourly wind data points for the month of january i.e 24 data points for each day (744 for 31 days) For each day I need to fit the 24 hourly data points with the non linear function C(1)+C(2).*sin(2*pi/24.*(x-C(3)))+C(4).*sin(2*pi/12.*(x-

Hi Gourav, this is not really a nonlinear problem. That's because dropping some parenthesis) C2*sin(2*pi/24*(x-C3)) = -C2*[ s...

I have 744 hourly wind data points for the month of january i.e 24 data points for each day (744 for 31 days) For each day I need to fit the 24 hourly data points with the non linear function C(1)+C(2).*sin(2*pi/24.*(x-C(3)))+C(4).*sin(2*pi/12.*(x-

Hi Gourav, this is not really a nonlinear problem. That's because dropping some parenthesis) C2*sin(2*pi/24*(x-C3)) = -C2*[ s...

25 days ago | 0

Answered

How could I find the maximum closed contour line?

Hello YC, Since a saddle point is where the contour lines go from closed to open, the idea is to find the location of the saddl...

How could I find the maximum closed contour line?

Hello YC, Since a saddle point is where the contour lines go from closed to open, the idea is to find the location of the saddl...

25 days ago | 0

Answered

Normalization of FFT output

Hello Vittorio, In the gaussian case, the waveform has died down to zero each end (technically it's not zero, but it is smaller...

Normalization of FFT output

Hello Vittorio, In the gaussian case, the waveform has died down to zero each end (technically it's not zero, but it is smaller...

26 days ago | 0

Answered

Error in a function

Hi Morne' Here Matlab assumed that the call to the function was part of the function itself. In a script, functions must be lo...

Error in a function

Hi Morne' Here Matlab assumed that the call to the function was part of the function itself. In a script, functions must be lo...

27 days ago | 0

Answered

FFT: scaling for correct amplitude

Hi Eric, It's not the specific details of the signal so much as it is the context. If you are transforming what is basically a...

FFT: scaling for correct amplitude

Hi Eric, It's not the specific details of the signal so much as it is the context. If you are transforming what is basically a...

28 days ago | 1

Answered

Different eigenvectors when using eig and null functions

Hi Mohammed, I tossed in some 'double' functions to make the comparison easier A = [3 2 ; 7 -1]; syms x; a2a = sym(A); pol...

Different eigenvectors when using eig and null functions

Hi Mohammed, I tossed in some 'double' functions to make the comparison easier A = [3 2 ; 7 -1]; syms x; a2a = sym(A); pol...

30 days ago | 1

| accepted

Answered

Time axis explanation required

Hi Saad, 'time' is (almost) the total length of the time record, so it will not be the spacing when setting up the time array. ...

Time axis explanation required

Hi Saad, 'time' is (almost) the total length of the time record, so it will not be the spacing when setting up the time array. ...

1 month ago | 0

Answered

Analizing the charges and discharges of a capacitor conected to a square wave voltage source

Hello Virginia, As you progress along the square wave, each time you get to a new half cycle there is of course a new applied v...

Analizing the charges and discharges of a capacitor conected to a square wave voltage source

Hello Virginia, As you progress along the square wave, each time you get to a new half cycle there is of course a new applied v...

1 month ago | 0

| accepted

Answered

How to solve a set of coupled odes that depend on derivatives

HI charlie, dx4' depends on dx2' and dx3' explicitly. But since dOmega_e_dz and dV_e_dz are also in the expression for dx4', d...

How to solve a set of coupled odes that depend on derivatives

HI charlie, dx4' depends on dx2' and dx3' explicitly. But since dOmega_e_dz and dV_e_dz are also in the expression for dx4', d...

1 month ago | 0

Answered

Issue with gammainc(x,a) for small x and larger a

Hi John, Matlab does not appear to have a symbolics version of the incomplete gamma function, but it's still possible to make p...

Issue with gammainc(x,a) for small x and larger a

Hi John, Matlab does not appear to have a symbolics version of the incomplete gamma function, but it's still possible to make p...

1 month ago | 0

Answered

im using 'dsolve' for 2nd ode with dirac function but matlab returns 1/2 of constant

Hi Song-Ha Your statement " the answer should be [constant] *exp(-0.4607 * t) * sin(3.0003*t) " is missing a very important f...

im using 'dsolve' for 2nd ode with dirac function but matlab returns 1/2 of constant

Hi Song-Ha Your statement " the answer should be [constant] *exp(-0.4607 * t) * sin(3.0003*t) " is missing a very important f...

1 month ago | 0

Answered

Hypergeometric Function in Matlab

Hello PM, The variable l does not come out so well in this font so I'll call it q instead. SInce both -q and -n are negative, ...

Hypergeometric Function in Matlab

Hello PM, The variable l does not come out so well in this font so I'll call it q instead. SInce both -q and -n are negative, ...

1 month ago | 0

| accepted

Answered

ODE45 Code Application

Hi James, [t,U] = ode45(@Velocity, [0, 20], .001); plot(t,U) function Udot = Velocity(t,U) M = 100/6*pi*0.04^3; g=9.8; A...

ODE45 Code Application

Hi James, [t,U] = ode45(@Velocity, [0, 20], .001); plot(t,U) function Udot = Velocity(t,U) M = 100/6*pi*0.04^3; g=9.8; A...

1 month ago | 1

| accepted

Answered

How to simplify a symbolic equation, but still keep the denominator

Hi LZ syms x y a b eqn1 = b*(x/a + 1) == b*y/a; % This is the equation, I would like to cancel "b" at both side, and still kee...

How to simplify a symbolic equation, but still keep the denominator

Hi LZ syms x y a b eqn1 = b*(x/a + 1) == b*y/a; % This is the equation, I would like to cancel "b" at both side, and still kee...

1 month ago | 1

| accepted

Answered

Eliminating and counting rows that contain a pattern that already appeared

Hello Spencer, I assume that the patterns you mean have a length of 5. The way that you have set the the problem, 44313 (B row...

Eliminating and counting rows that contain a pattern that already appeared

Hello Spencer, I assume that the patterns you mean have a length of 5. The way that you have set the the problem, 44313 (B row...

1 month ago | 0

| accepted

Answered

Fast Fourier Transform component detection issue

Hello awezmm, This occurs because of a combination of aliasing and the spacing of the chosen frequencies. For sampling frequen...

Fast Fourier Transform component detection issue

Hello awezmm, This occurs because of a combination of aliasing and the spacing of the chosen frequencies. For sampling frequen...

1 month ago | 1

| accepted

Answered

My code won't run, related to ode function

Hi Dardenella, try the same thing only with [t,Y] = ode45(@(t,Y) f(t,Y,omega0,p), [0,10],[y0,v0]); % solve for 0<t<10 [n...

My code won't run, related to ode function

Hi Dardenella, try the same thing only with [t,Y] = ode45(@(t,Y) f(t,Y,omega0,p), [0,10],[y0,v0]); % solve for 0<t<10 [n...

1 month ago | 0

Answered

How to make specific elements in a 3D matrix zero?

Hi Rabia, try for yy=1:10 temp = Costyearlydata(:,:,yy); temp(D(:,1,yy)) = 0; cost1(:,:,yy) = temp; end

How to make specific elements in a 3D matrix zero?

Hi Rabia, try for yy=1:10 temp = Costyearlydata(:,:,yy); temp(D(:,1,yy)) = 0; cost1(:,:,yy) = temp; end

2 months ago | 0

| accepted

Answered

constructing a difficult large matrix

Hi ektor, I presume you are interested not so much in the in the matrix A as in the 1000 scalars you get after you multiply eac...

constructing a difficult large matrix

Hi ektor, I presume you are interested not so much in the in the matrix A as in the 1000 scalars you get after you multiply eac...

2 months ago | 0

| accepted

Answered

Plot the travel for an electron by using ode45 (involving matrices)

Hi Ibrahim, There is nothing wrong with using matrices in this situation, and the plot is fine, insofar as it is plotting what ...

Plot the travel for an electron by using ode45 (involving matrices)

Hi Ibrahim, There is nothing wrong with using matrices in this situation, and the plot is fine, insofar as it is plotting what ...

2 months ago | 1

| accepted