Answered

how can i simplify this expression

Hi Dror, n1 = 10; % in case the dimensions are not all the same n2 = 6; n3 = 33; n4 = 28; u = rand(n1,n2,n3,n4) + i*rand(n...

how can i simplify this expression

Hi Dror, n1 = 10; % in case the dimensions are not all the same n2 = 6; n3 = 33; n4 = 28; u = rand(n1,n2,n3,n4) + i*rand(n...

etwa 15 Stunden ago | 0

Answered

Code not working, velocity comes back the same each time

Hello Oliver, could you say where you got this problem? I am interesed in finding out since the problem keeps reoccurring on t...

Code not working, velocity comes back the same each time

Hello Oliver, could you say where you got this problem? I am interesed in finding out since the problem keeps reoccurring on t...

ein Tag ago | 0

Answered

Normalization for the fft of a wavefunction in momentum space

Hi Peter, the factor of 1/N is used to find the amplitudes of continuous wave sines and cosines. Here you are approximating a ...

Normalization for the fft of a wavefunction in momentum space

Hi Peter, the factor of 1/N is used to find the amplitudes of continuous wave sines and cosines. Here you are approximating a ...

ein Tag ago | 1

| accepted

Answered

How to fix this weird plot behaviour?

Hi Adrian, figure(1) plot(vysledkyM, 'r'); ylim([678, 685]) hold on plot(vysledkyU, 'b'); plot(vysledkyS, 'g'); legend('d...

How to fix this weird plot behaviour?

Hi Adrian, figure(1) plot(vysledkyM, 'r'); ylim([678, 685]) hold on plot(vysledkyU, 'b'); plot(vysledkyS, 'g'); legend('d...

7 Tage ago | 1

Answered

FFT Fast Fourier Result not stable

Hi HZ, It's good that you are working this stuff out. Not enought people do that. WIth a few exceptions the result of an fft ...

FFT Fast Fourier Result not stable

Hi HZ, It's good that you are working this stuff out. Not enought people do that. WIth a few exceptions the result of an fft ...

7 Tage ago | 1

| accepted

Answered

Is it possible to make Acos return values greater than pi?

Hi Berke, I wrote a clarification to your previous question which I think should resolve that issue. It looks like you have de...

Is it possible to make Acos return values greater than pi?

Hi Berke, I wrote a clarification to your previous question which I think should resolve that issue. It looks like you have de...

8 Tage ago | 1

| accepted

Answered

Using ifft2 to transform wavenumber-frequency to space-time

Chirag, It's pretty clear in the time domain. With array spacings delt and delf in the time and frequency domain respectively,...

Using ifft2 to transform wavenumber-frequency to space-time

Chirag, It's pretty clear in the time domain. With array spacings delt and delf in the time and frequency domain respectively,...

8 Tage ago | 0

Answered

Determining the phase shift from the samples of the sinusoidal wave?

Assuming that w is known, and that you have an identical time array for each of A and B, and that t and B are column arrays, the...

Determining the phase shift from the samples of the sinusoidal wave?

Assuming that w is known, and that you have an identical time array for each of A and B, and that t and B are column arrays, the...

8 Tage ago | 0

| accepted

Answered

How to determine time lag by using xcorr ?

Hello Linda, the idea is basically correct, but for two signals of the same length, zero lag is at the center of the resulting ...

How to determine time lag by using xcorr ?

Hello Linda, the idea is basically correct, but for two signals of the same length, zero lag is at the center of the resulting ...

8 Tage ago | 0

| accepted

Answered

ODE45 Returning Wrong Signed Answer

Hi h7, I'm guessing that you want to start at 60 degrees and not 60 radians, so try y0 = [60*pi/180;0]; [ts,ys] = ode45(@ph...

ODE45 Returning Wrong Signed Answer

Hi h7, I'm guessing that you want to start at 60 degrees and not 60 radians, so try y0 = [60*pi/180;0]; [ts,ys] = ode45(@ph...

9 Tage ago | 0

| accepted

Answered

one-to-one mapping of a vector based on error bounds

Hi Jonah, x(-14 < x & x < -8) = -13; x(-8 < x & x < -2) = -6; What happens if x =8? Looks like you could use <= in pla...

one-to-one mapping of a vector based on error bounds

Hi Jonah, x(-14 < x & x < -8) = -13; x(-8 < x & x < -2) = -6; What happens if x =8? Looks like you could use <= in pla...

11 Tage ago | 0

Answered

The spacecraft free-fall math model

Hi Sanzhar & Luke, This problem keeps bouncing around on other posts, so it's time to check out what is going on. Although the...

The spacecraft free-fall math model

Hi Sanzhar & Luke, This problem keeps bouncing around on other posts, so it's time to check out what is going on. Although the...

11 Tage ago | 1

Answered

How to generate a round robin schedule with 4 players in each game

HI Jacob, here's a standard way to create an n team round robin schedule (n even), teams plays each other once. sched = [mod([...

How to generate a round robin schedule with 4 players in each game

HI Jacob, here's a standard way to create an n team round robin schedule (n even), teams plays each other once. sched = [mod([...

12 Tage ago | 0

Answered

Why does the rotate function let the body rotate around the wrong axis?

Hello Felix, this shold be (assuming that the object's center is at (0,0,0) ) tilt = 23.4; rotationangle = 30; % for example...

Why does the rotate function let the body rotate around the wrong axis?

Hello Felix, this shold be (assuming that the object's center is at (0,0,0) ) tilt = 23.4; rotationangle = 30; % for example...

13 Tage ago | 0

Answered

solve numerically a system of three equations the first of which defines a function and the rest of two involve integrals

Hi YG, Not having the toolbox for fsolve, I can't do any comparison calculations. As is usually the case, there is a tradoff b...

solve numerically a system of three equations the first of which defines a function and the rest of two involve integrals

Hi YG, Not having the toolbox for fsolve, I can't do any comparison calculations. As is usually the case, there is a tradoff b...

14 Tage ago | 0

Answered

Why fft results of discrete Fourier series coefficients are different from the actual definition

Hi Romio, I believe you are referriing to the convention where (informally speaking) f(x) = Sum c_n exp( 2*pi*i*f0*n*x) ...

Why fft results of discrete Fourier series coefficients are different from the actual definition

Hi Romio, I believe you are referriing to the convention where (informally speaking) f(x) = Sum c_n exp( 2*pi*i*f0*n*x) ...

17 Tage ago | 0

| accepted

Answered

How to solve parametric system of vector equations?

Hi Daniel, interesting problem. does this correspond to a particular physical situation? % P1 --> a, P2 --> b % solution i...

How to solve parametric system of vector equations?

Hi Daniel, interesting problem. does this correspond to a particular physical situation? % P1 --> a, P2 --> b % solution i...

19 Tage ago | 1

| accepted

Answered

Spline and PPL discrete points

Hi Dhruv. your choice of a = 0.125 is kind of messing things up, because it's well above where the data ends. If you go only ...

Spline and PPL discrete points

Hi Dhruv. your choice of a = 0.125 is kind of messing things up, because it's well above where the data ends. If you go only ...

20 Tage ago | 0

| accepted

Answered

solve numerically a system of three equations the first of which defines a function and the rest of two involve integrals

Hello YG, Fortunately the first equation is amenable to interation, at least for some parameters. In the code below, zeta1 --...

solve numerically a system of three equations the first of which defines a function and the rest of two involve integrals

Hello YG, Fortunately the first equation is amenable to interation, at least for some parameters. In the code below, zeta1 --...

20 Tage ago | 0

| accepted

Answered

Trying to graph two differential equations on same plot

Hi Rodrigo, you have the following: function dydt=jallohwfun7(alpha,ep,xf,y,cao,k2,Fao) dydt=zeros(2,1); dydt(1)=-alpha*(1+e...

Trying to graph two differential equations on same plot

Hi Rodrigo, you have the following: function dydt=jallohwfun7(alpha,ep,xf,y,cao,k2,Fao) dydt=zeros(2,1); dydt(1)=-alpha*(1+e...

22 Tage ago | 1

| accepted

Answered

How to use tril function on only specific columns in a large matrix?

Hi Zuha, here's another, more vectorized version m = rand(31413,950); [r c] = size(m); [jj ii] = meshgrid(1:c,1:8); % ii ro...

How to use tril function on only specific columns in a large matrix?

Hi Zuha, here's another, more vectorized version m = rand(31413,950); [r c] = size(m); [jj ii] = meshgrid(1:c,1:8); % ii ro...

22 Tage ago | 0

Answered

Keep getting an error message when integrating

Hi Rodrigo, try adding a dot to the function definition line, for element-by-element division: fun=@(x) Fao/(cao*k2)*(1+ep*x)....

Keep getting an error message when integrating

Hi Rodrigo, try adding a dot to the function definition line, for element-by-element division: fun=@(x) Fao/(cao*k2)*(1+ep*x)....

22 Tage ago | 2

| accepted

Answered

Solving an ODE for a Complex Variable in Polar Coordinates

Hi Cameron, to solve the differential equation, ode needs real inputs so you could either use z = x+iy in the usual way or use ...

Solving an ODE for a Complex Variable in Polar Coordinates

Hi Cameron, to solve the differential equation, ode needs real inputs so you could either use z = x+iy in the usual way or use ...

22 Tage ago | 2

| accepted

Answered

How to create a function as the convolution of two functions? Thanks

Hello James, fune=@(e)(e>=0).*(e<=1); funz=@(z)(z>=0).*(z<=1); funezt=@(ez,t)fune(ez-t).*funz(t); funez=@(ez)integral(@(t)fu...

How to create a function as the convolution of two functions? Thanks

Hello James, fune=@(e)(e>=0).*(e<=1); funz=@(z)(z>=0).*(z<=1); funezt=@(ez,t)fune(ez-t).*funz(t); funez=@(ez)integral(@(t)fu...

22 Tage ago | 1

| accepted

Answered

for loop. finding the right index

Hello Ireedui, max and min find the indices as well as the values. changeInSOE = diff(stateOfEnergy) % find all the differen...

for loop. finding the right index

Hello Ireedui, max and min find the indices as well as the values. changeInSOE = diff(stateOfEnergy) % find all the differen...

23 Tage ago | 1

| accepted

Answered

Can I determine the points (x,y) with a single line looping back and cross its self?

Hi A C Good one. I'm assuming that the x and y arrays are such that x(1:end),y(1:end) traces out a 'continuous' (so to speak) ...

Can I determine the points (x,y) with a single line looping back and cross its self?

Hi A C Good one. I'm assuming that the x and y arrays are such that x(1:end),y(1:end) traces out a 'continuous' (so to speak) ...

etwa ein Monat ago | 1

Answered

arc length parametrization help me

Hello HY, You just need to go back to the basics. There is a vector x,y,z defined by a parameter (t in this case), so the rate...

arc length parametrization help me

Hello HY, You just need to go back to the basics. There is a vector x,y,z defined by a parameter (t in this case), so the rate...

etwa ein Monat ago | 0

Answered

How to generate samples for cauchy distribution

Hi Mudit, the Cauchy distribtiion doesn't have a variance, since it doesn't have moments. But it does have a scale factor b. ...

How to generate samples for cauchy distribution

Hi Mudit, the Cauchy distribtiion doesn't have a variance, since it doesn't have moments. But it does have a scale factor b. ...

etwa ein Monat ago | 0

Answered

Scalar coefficients for a linear combination of matrices

HI Pierre-Luc [M(:) N(:)]\C(:) produces [a;b] This assumes that M and N are not proportional to each other, otherwise there...

Scalar coefficients for a linear combination of matrices

HI Pierre-Luc [M(:) N(:)]\C(:) produces [a;b] This assumes that M and N are not proportional to each other, otherwise there...

etwa ein Monat ago | 0

| accepted

Answered

Solving function in Matlab

Hi HD, Never a bad idea to do a plot. I modified the code a bit, so it does vector in with Ms, vector out. Could you explain ...

Solving function in Matlab

Hi HD, Never a bad idea to do a plot. I modified the code a bit, so it does vector in with Ms, vector out. Could you explain ...

etwa ein Monat ago | 0