Risposto
Exponential function produces error with integrate command
Hi Ben for large x, exp(x) overflows to infinity before the exp(-(x.^2)/2) factor has a chance to bring in down. Try completin...

circa 5 anni fa | 0

| accettato

Risposto
Even distribution of coordinates subset
Hi Giovanni, here is one method, which assumes that B is supposed to span basically the entire domain of A. Suppose the set of...

circa 5 anni fa | 0

| accettato

Risposto
Why does pcolor require you to transpose the matrix when you give it x and y vectors?
Hi Darcy. pcolor works in the same fashion as meshgrid, and creates a grid with nx = length(x) columns and ny = length(y) rows....

circa 5 anni fa | 0

Risposto
Undefined function 'sinc' for input arguments of type 'double'.
Hi boutaina, Since it's easy in Matlab to make your own functions, you don't need toolboxes that are (probably not intentionall...

circa 5 anni fa | 0

Risposto
Choose Lyapunov function of a linear system
Hi Cristina, The first part of this is probably telling you what you already know, but denoting C = c*[1 -1 0; 0 1 -1; -1 0 1]...

circa 5 anni fa | 0

Risposto
orthagonal planes and normal vectors
Hi M, A plane satisfies the dot product equation equation r dot v = const where r is the position vector [x y z] and v = [vx ...

oltre 5 anni fa | 3

| accettato

Risposto
How to generate a random complex unitary matrix whose columns each sum up to 1
MODIFIED to replace previous random function Hi Michael, here is one way. It's based on the idea that if the unitary matrix U...

oltre 5 anni fa | 1

| accettato

Risposto
Solving a 3 degree of freedom mass spring damper model
Hi Z^2, Now that you have the K, C and M matrices, you can create a matrix equation to find the natural resonant frequencies. G...

oltre 5 anni fa | 0

Risposto
Solve for the constants of a Quartic given the complex roots?
Hi Johnathan, r = [-5 -6 -9.6+25.7i -9.6-25.7i]; p = poly(r) r1 = roots(p) % check p = 1.0e+04 * 0.0001 0.0030 ...

oltre 5 anni fa | 0

| accettato

Risposto
Coding a function for the Fourier Transform.
Hi Anthony, the only problem here is the normalization. For the inverse transform you are dividing by sqrt(N) every time, (N b...

oltre 5 anni fa | 0

| accettato

Risposto
Ignoring NaNs for polyfit
Hello TimaMarie, yes, polyfit doesn't like NaNs. One way out is, just before doing polyfit, toss out the elements of both vari...

oltre 5 anni fa | 0

| accettato

Risposto
Find first item with a certain condition and use it, instead of finding all items with that condition
Hi Thomas, [After reading comments from Bruno and Rik I realized I forgot to mention that in order to get your code to run I ch...

oltre 5 anni fa | 1

Risposto
Fzero returning wrong root
Hello Emily If you insert this F_theta = double(F_theta); just after the calculation of F_theta, you will get the correct res...

oltre 5 anni fa | 2

| accettato

Risposto
Solution of differential equations with an input derivative
Hi Pawel, you have e = -x(1) + 1; so de/dt = d/dt(-x(1) + 1) = -dx(1)/dt but dx(1)/dt = (x(2)-x(1))/T2 so you can replace...

oltre 5 anni fa | 1

| accettato

Risposto
quat2angle different result
Hi Sven, it's pretty clear that both test and original have discontinuities because the function producing the angles, probably...

oltre 5 anni fa | 0

Risposto
WHY ARE THE COLORS OF MY LEGEND ALL MESSED UP?
Hi OI, One reason that Sylvain posted his comment is that you do not provide working code. And of course your odds of getting ...

oltre 5 anni fa | 1

Risposto
Why do I get too high dominant frequencies in FFT
Hi Timo, From your attached data I can see that it's 2 sec at 48 kHz as you said. In your frequency plot, the data seems to be...

oltre 5 anni fa | 0

Risposto
fitting only continous line
Hi salman, I have been off taking a look at this problem. The method below uses the fact that what you call the discontinouus ...

oltre 5 anni fa | 0

| accettato

Risposto
ilaplace returns unexpected answer
Hi Abdulla, You mention +- 3 as the coefficient, but are using +-6 in the actual example so I will stay with that. Looking at ...

oltre 5 anni fa | 0

| accettato

Risposto
Changing the amplitude (y-axis) of an FFT back to units of force.
Hi Kev, The first thing is, the time and frequency arrays have to be correct. You are not actually using the 'time' variable b...

oltre 5 anni fa | 1

Risposto
How to avoid an Infinite Loop?
Waseem, Nothing in the entire while loop alters either 'sizes' or 'sizesB'. So if sizes(1) ~= sizesB(1), that condition will ...

oltre 5 anni fa | 0

Risposto
Calculation of antenna efficiency
Hi Shahar, The plot is of directivity, not gain (confusingly, directivity is sometimes called directive gain). Since directivi...

oltre 5 anni fa | 0

| accettato

Risposto
How can I obtain the mean and standard deviation of a gaussian PDF
Hi Matthew, here is an example, where mu and sigma are calculated by numerical integration. Also shown are analytical results ...

oltre 5 anni fa | 1

| accettato

Risposto
Why am I getting Complex number results?
Hello Ethan, The reason for this is that at step i = 14, the quantity on the third to last line, (1-(c*y(i)/T)) becomes negativ...

oltre 5 anni fa | 1

Risposto
Poisson Boltzmann eq. with an infinite boundary condition
Hi Roi For convenience I will use u in place of psi. An exact solution is tanh(u/4) = A*exp(-x) where A = tanh(1/4) ...

oltre 5 anni fa | 1

Risposto
Can I use the PDEPE solver to solve the following dimensionless Transient PFR PDE? If not, what method do you reconmend?
Hello Rogelio, For psi(t,eta) I assume that the boundary conditions are psi(0,eta) = 0 for all eta an...

oltre 5 anni fa | 0

Risposto
double peaks in FFT matlab
Hello hamzah the fft is a complex function. Are you plotting only the real part? This problem is occurring because your delta...

oltre 5 anni fa | 0

Risposto
How to plot wavelength and wavenumber FFT from intensity data
Hi Arwi, n = 3648, dpix = 8e-9; % 8nm seems small for a pixel width The x array has spacing delx = dpix and is x = delx*(0:...

oltre 5 anni fa | 0

Risposto
Verifying the uncertainty principle with fft for Gaussian
Hello Ori, The problem stems from the following, where I am using t and f rather than x and k (see comment). For an fft, once ...

oltre 5 anni fa | 0

| accettato

Risposto
why the Real and imaginary part of fourier transform (fft) are not zero for real odd function
Hi Jiali, with an even number of points the symmetry is not quite right. In the frequency domain, for eight points (without an...

oltre 5 anni fa | 0

| accettato

Carica altro