Answered

Implementing a sum with summands of unequal spacing inside an integral

Hi Richard, I don't claim to be a professional although I did use Matlab at work, and here is how I would do this. The main th...

Implementing a sum with summands of unequal spacing inside an integral

Hi Richard, I don't claim to be a professional although I did use Matlab at work, and here is how I would do this. The main th...

2 dagar ago | 1

| accepted

Answered

Does the permute function have a bug?

Hello ZY, see 'help permute'. Permute puts the dimensions in the order listed, so in this case the old 4th dimension goes firs...

Does the permute function have a bug?

Hello ZY, see 'help permute'. Permute puts the dimensions in the order listed, so in this case the old 4th dimension goes firs...

2 dagar ago | 0

| accepted

Answered

Is it possible to create periodic boundary conditions for a matrix with linear indexing?

Hi Tom, mod(k,N)+1 for the raised index, k+1 mod(k-2,N)+1 for the lowered index, k-1 and these do give the correct vector of ...

Is it possible to create periodic boundary conditions for a matrix with linear indexing?

Hi Tom, mod(k,N)+1 for the raised index, k+1 mod(k-2,N)+1 for the lowered index, k-1 and these do give the correct vector of ...

5 dagar ago | 0

| accepted

Answered

how to solve the equation: xdot=AX+Bu; where u=sin(2t)

Hi Ebraheem, ode45 is fine with explicit time dependence in the calculation of xdot: [t, x] = ode45(@smc5,[0, 10],[1, -2]) pl...

how to solve the equation: xdot=AX+Bu; where u=sin(2t)

Hi Ebraheem, ode45 is fine with explicit time dependence in the calculation of xdot: [t, x] = ode45(@smc5,[0, 10],[1, -2]) pl...

5 dagar ago | 2

| accepted

Answered

Series expansion with Legendre polynomials

HI James, I won't address how one might print the result, but the mistake in the algrbra is that you should use y(i) = ((2*i+1...

Series expansion with Legendre polynomials

HI James, I won't address how one might print the result, but the mistake in the algrbra is that you should use y(i) = ((2*i+1...

5 dagar ago | 0

Answered

Chua Oszillator in Matlab, Chaos

Hi Albin, In your second version, the equation for xdot is dimensionally incorrect. Changing it to xdot = (1/C1)*(G*(y-x-g));...

Chua Oszillator in Matlab, Chaos

Hi Albin, In your second version, the equation for xdot is dimensionally incorrect. Changing it to xdot = (1/C1)*(G*(y-x-g));...

6 dagar ago | 0

Answered

Meshing a complex function with limits

Hello Haider, for someone who is new to Matlab you are doing well. You just need a couple of changes. First, you forgot that r...

Meshing a complex function with limits

Hello Haider, for someone who is new to Matlab you are doing well. You just need a couple of changes. First, you forgot that r...

9 dagar ago | 1

| accepted

Answered

plot Gibbs phenomenon individually???

Hi Neptune, I agree that my comment on what the Gibbs phenomenon actually is was not very helpful to the actual problem at hand...

plot Gibbs phenomenon individually???

Hi Neptune, I agree that my comment on what the Gibbs phenomenon actually is was not very helpful to the actual problem at hand...

11 dagar ago | 0

| accepted

Answered

Automatic Complex Conjugate in ftt

Hello Ha Oe the quote command is not just the transpose, it's the complex conjugate transpose (Hermetian conjugate). For the s...

Automatic Complex Conjugate in ftt

Hello Ha Oe the quote command is not just the transpose, it's the complex conjugate transpose (Hermetian conjugate). For the s...

11 dagar ago | 1

| accepted

Answered

The input signal is complex conjugate, but the IFFT output is complex!

Hello yz, The problem is that to produce a real ifft, the first element of Ax, which is the f=0 term, has to be real since that...

The input signal is complex conjugate, but the IFFT output is complex!

Hello yz, The problem is that to produce a real ifft, the first element of Ax, which is the f=0 term, has to be real since that...

11 dagar ago | 1

| accepted

Answered

Why is dsolve returning an arbitrary constant?

Hi David, you need slightly different syntax. syms y(t) g L c Dy = diff(y) S = dsolve(diff(diff(y(t))) -L*y - g == 0, y(0) =...

Why is dsolve returning an arbitrary constant?

Hi David, you need slightly different syntax. syms y(t) g L c Dy = diff(y) S = dsolve(diff(diff(y(t))) -L*y - g == 0, y(0) =...

12 dagar ago | 0

| accepted

Answered

How to plot a maximum value on an existing line graph

Hi Grace, Here is an example of what I think you are looking for. The idea is to use the second output of max to find the inde...

How to plot a maximum value on an existing line graph

Hi Grace, Here is an example of what I think you are looking for. The idea is to use the second output of max to find the inde...

12 dagar ago | 0

Answered

Matlab output is not matching with the mathematics...

Hi Hari, the problem is that 2*pi*f*t is a nice linear function of t for all t, but the output of acos is restricted to the ran...

Matlab output is not matching with the mathematics...

Hi Hari, the problem is that 2*pi*f*t is a nice linear function of t for all t, but the output of acos is restricted to the ran...

12 dagar ago | 1

| accepted

Answered

Non Linear DE solving using ODE45

Hi Muhammad, with that set of constants, the time has not been run out far enough to see the final result. Try changing the ti...

Non Linear DE solving using ODE45

Hi Muhammad, with that set of constants, the time has not been run out far enough to see the final result. Try changing the ti...

12 dagar ago | 0

| accepted

Answered

ODE45 calculating the total energy in the system and checking the solver

Hi Kostas, The problem is in the calculation of the dissipated energy which is not any kind of sum of (y C dy/dt), but rather t...

ODE45 calculating the total energy in the system and checking the solver

Hi Kostas, The problem is in the calculation of the dissipated energy which is not any kind of sum of (y C dy/dt), but rather t...

12 dagar ago | 0

| accepted

Answered

Constructing an FFT-like result array.

HI betz, All of the following applies if the time domain waveform is REAL For a N point fft, N even: (a) point 1 is the four...

Constructing an FFT-like result array.

HI betz, All of the following applies if the time domain waveform is REAL For a N point fft, N even: (a) point 1 is the four...

22 dagar ago | 1

| accepted

Answered

Equation of Motion is Blowing Up

HI Samuel, I won't have access to Matlab for a few days so this needs to be verified, but I believe that in the last line of th...

Equation of Motion is Blowing Up

HI Samuel, I won't have access to Matlab for a few days so this needs to be verified, but I believe that in the last line of th...

26 dagar ago | 0

Answered

transfer functions arithmetic - is it distributive?

Hi Kapil, The second expression is merely the first expression multiplied by (z-1)/(z-1). So the two are equivalent, with the s...

transfer functions arithmetic - is it distributive?

Hi Kapil, The second expression is merely the first expression multiplied by (z-1)/(z-1). So the two are equivalent, with the s...

26 dagar ago | 0

Answered

How can I re-write an anonymous function into a standard function?

Hi Jesus, [ CORRECTED to include a minus sign ] function [returns,variance] = MultiObjective(mu,C,w) returns = -mu'*w'; ...

How can I re-write an anonymous function into a standard function?

Hi Jesus, [ CORRECTED to include a minus sign ] function [returns,variance] = MultiObjective(mu,C,w) returns = -mu'*w'; ...

27 dagar ago | 0

| accepted

Answered

I'm trying to ad a condition to an equation

Hi Xavier, I don't think your original function is overcomplicated at all. It's straightforward code that is self-commenting, ...

I'm trying to ad a condition to an equation

Hi Xavier, I don't think your original function is overcomplicated at all. It's straightforward code that is self-commenting, ...

29 dagar ago | 1

Answered

Cholesky Decomposition Column-Wise Algorithm Implementation

Hi J, I added to the code in your last comment by including the obvious missing 'for' statements, etc. After that, it's pretty...

Cholesky Decomposition Column-Wise Algorithm Implementation

Hi J, I added to the code in your last comment by including the obvious missing 'for' statements, etc. After that, it's pretty...

2 månader ago | 1

| accepted

Answered

scientific notation in each element

Hi c^2, try "format short g" beforehand. Things stay that way until further notice. To go back to the default you can use ...

scientific notation in each element

Hi c^2, try "format short g" beforehand. Things stay that way until further notice. To go back to the default you can use ...

2 månader ago | 0

| accepted

Answered

FFT of ON OFF signal

Hi imran, you appear to be pretty close on this. The code below uses ftshift to put f = 0 at the middle of the freq array, and...

FFT of ON OFF signal

Hi imran, you appear to be pretty close on this. The code below uses ftshift to put f = 0 at the middle of the freq array, and...

3 månader ago | 0

| accepted

Answered

Centered FFT & DFT: cannot devise required phase shift vector(s).

Hi Peter, here are some phase shifts. I shortened up some of the variable names to make it easier (for me, anyway) to follow w...

Centered FFT & DFT: cannot devise required phase shift vector(s).

Hi Peter, here are some phase shifts. I shortened up some of the variable names to make it easier (for me, anyway) to follow w...

3 månader ago | 1

| accepted

Answered

Why is 1/ones(3,1) OK while 1/ones(1,3) is not OK?

Hi Yuki, In the expression x = 1/ones(3,1) multiplying both sides on the right by ones(3,1) gives x*ones(3,1) = 1. The row ve...

Why is 1/ones(3,1) OK while 1/ones(1,3) is not OK?

Hi Yuki, In the expression x = 1/ones(3,1) multiplying both sides on the right by ones(3,1) gives x*ones(3,1) = 1. The row ve...

3 månader ago | 2

| accepted

Answered

Bivariate Normal Distribution different for expression and mvnpdf()

Hello Aishwarya, The problem here is that the array x is 2x31 and does not have every possible combination of an element of X1 ...

Bivariate Normal Distribution different for expression and mvnpdf()

Hello Aishwarya, The problem here is that the array x is 2x31 and does not have every possible combination of an element of X1 ...

3 månader ago | 2

| accepted

Answered

How do you find the approximate interval that displays the solution?

Hello Isabel, I believe the idea here is that when lambda is large enough, the expression for Tb gets increasingly close to Tb_...

How do you find the approximate interval that displays the solution?

Hello Isabel, I believe the idea here is that when lambda is large enough, the expression for Tb gets increasingly close to Tb_...

3 månader ago | 0

Answered

ODE45 to solve a system of two coupled 2nd order ODEs

Hi Ricardo, I am inferring that you have the following system with fixed points S: S---k1---M---k2---M---k1---S Then eqn 1 is...

ODE45 to solve a system of two coupled 2nd order ODEs

Hi Ricardo, I am inferring that you have the following system with fixed points S: S---k1---M---k2---M---k1---S Then eqn 1 is...

3 månader ago | 0

| accepted

Answered

How to element wise exponential of a matrix

Hi Titas, dy = Columns 1 through 10 15.7800 31.5600 47.3400 63.1200 78.9000 94.6800 110.4600 126.2400 142.0200...

How to element wise exponential of a matrix

Hi Titas, dy = Columns 1 through 10 15.7800 31.5600 47.3400 63.1200 78.9000 94.6800 110.4600 126.2400 142.0200...

3 månader ago | 1

| accepted

Answered

Anttena Paterns radiation patterns

Hello MT, The basic issue is setting phi_3db to degrees, but there may also be a problem with the basic definition of phi_3db (...

Anttena Paterns radiation patterns

Hello MT, The basic issue is setting phi_3db to degrees, but there may also be a problem with the basic definition of phi_3db (...

3 månader ago | 0

| accepted