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...

4 dagar 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 ...

4 dagar 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...

5 dagar 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,...

6 dagar 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...

6 dagar 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 ...

6 dagar 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...

6 dagar 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...

8 dagar 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...

9 dagar 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([...

10 dagar 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...

10 dagar 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...

12 dagar 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) ...

14 dagar 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...

16 dagar 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 ...

17 dagar 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 --...

18 dagar 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...

19 dagar 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...

19 dagar 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)....

19 dagar 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 ...

19 dagar 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...

19 dagar 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...

20 dagar 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) ...

28 dagar 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...

30 dagar 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. ...

ungefär en månad 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...

ungefär en månad 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 ...

ungefär en månad ago | 0

Answered

Weird result, why I can't find -0.809 and 0.309 in -1:0.001:1???

Hello JX, you are looking for exact equality with floating point numbers, and a exact equality does not always occur. x = -1:....

Weird result, why I can't find -0.809 and 0.309 in -1:0.001:1???

Hello JX, you are looking for exact equality with floating point numbers, and a exact equality does not always occur. x = -1:....

ungefär en månad ago | 0

| accepted

Answered

Back-Calculating to Match Previously Established Variable

Hi Jonathan, you don't show the curve y(x), but given the number of points in x it appears that the curve y(x) is dense in poin...

Back-Calculating to Match Previously Established Variable

Hi Jonathan, you don't show the curve y(x), but given the number of points in x it appears that the curve y(x) is dense in poin...

ungefär en månad ago | 0

Answered

TE mode trascendental equation problem

Hi Carolina, do you have a reference for where you read that dielectric fibers have no cutoff frequency? I would be interested...

TE mode trascendental equation problem

Hi Carolina, do you have a reference for where you read that dielectric fibers have no cutoff frequency? I would be interested...

ungefär en månad ago | 0