Réponse apportée
Can someone tell me why my error is so large for my composite simpsons rule?
Hi Briyahna, Yes the Simpson's rule expression is wrong, but only in the typo sense of having a misplaced parenthesis. Inste...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
CDF for Loglogistic distribution
Hello ZC, They are equivalent. In Matlab cdf = e^z / (1+e^z) % the missing one pdf = (1/(si...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
Problem with drag in Ballistic Calculator
Hi John, I wonder a bit about the units and dimensions, but let's say they are good. There is a problem with FD, as you surm...

plus de 7 ans il y a | 0

Réponse apportée
Lower and upper incomplete gamma function
Hi Shashibhushan, A couple of things. First, the calling variable order to gammainc needs to be reversed. Second, Matlab ga...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
fft of even number of elements of pulse yields one or multiple zeros in the array. How do I avoid this?
Hi Keith, This is happening because the array length of 16 (after you zerofill) and a pulse length of 4 have a factor in comm...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to find the number of occurrences of each pair in a matrix?
Hi MSK, nrow = size(A,1); B = A(:); s1 = full(sparse(B(1:end-nrow),B(nrow+1:end),1)) puts instances if i,j into ...

plus de 7 ans il y a | 0

Réponse apportée
I am trying to apply DCT compression on an image 1024 *1024 but I want to divide this image into 8*8 sub blocks. How can I divide this image to 8*8 sub blocks? can anybody help me please
Hi John, Here is one approach. For 8x8 blocks, you basically have a 256x256 matrix where each 'element' is an 8x8 block. Th...

plus de 7 ans il y a | 0

Réponse apportée
1d Convolution using Matlab's conv() function
Hi B^3S, Your last example, the one you are having problems with, is incorrect. You should be using [1 2 1 3 1] but you are ...

plus de 7 ans il y a | 0

Réponse apportée
How to do a phase shift of a signal from FFT output data
Hi matteo, MODIFIED here is an approximate way to do this. The code below stays with the entire frequency array, rather t...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
How do I make my function identify the root of a function within an interval?
Hi NS, You need to take a look at how this algorithm could fail. If f(x0) and f(x1) have opposite signs, then one or the othe...

plus de 7 ans il y a | 0

Réponse apportée
Does logint function work well? (for PNT)
Hi Notae, The reason for this is something that Derbyshire relegated to a footnote several pages before (p. 335, 128). If yo...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
FFT gives different amplitudes for different freqeuncies
Hi Fabio, Good observation. The reason for this is when there are an exact integer number of cycles in the time record, you ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How do I get the value of the associated Legendre function P^n_m(x) where P^n_0(x) is the Legendre polynomial?
Hi Kevin, If try, say legendre(5,.1) you get an output vector for all values of m <=5.

plus de 7 ans il y a | 0

Réponse apportée
Finding frequency of noise signal using FFT
Hi Nhat Dinh, Your frequency grid is basically correct. Unfortunately you are right. With a sampling frequency of only 10 H...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How do find the frequency from a FFT graph?
Hi Aidil, if there are N points in the data array, then the frequency array consists of N points with spacing fs/N. The foll...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How can I perform Fourier Synthesis with cosine waves?
Hi Julius Every fourier series is potentially a sum of both sines and cosines. It so happens that the much-overused square w...

presque 8 ans il y a | 1

| A accepté

Réponse apportée
RLC Transfer Function Magnitude and Phase Response
Hi 2e9, I don't know why you feel that the resonant circular frequency (w) should be 3.55e6 since 1/sqrt(L*C) = 2.24e7. The ...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
How to find the equation of a straight line in 3D?
Hi Federico, Are you looking for a parametric description? It's constructive. p1 = rand(1,3) p2 = rand(1,3) u = (...

presque 8 ans il y a | 1

| A accepté

Réponse apportée
create random diagonalisable matrix
Hi Gary, another way: n = 7 % A is nxn m = 9 % random integers from 1 to m X = randi...

presque 8 ans il y a | 4

| A accepté

Réponse apportée
How to permute a row vector based on sepecfic method for permutation?
Hi Sarah, Since you have more than 28 elements in the final array I would not call it a permutation of elements, strictly spe...

presque 8 ans il y a | 1

| A accepté

Réponse apportée
Appending trailing zeros to integers in a vector
Hi Maamoun, try x = [2, 13, 901, 5, 18, 7, 112, 5931]; y = floor(log10(x)) xnew = x.*10.^(max(y)-y)

presque 8 ans il y a | 2

| A accepté

Réponse apportée
transfer function of a geometry to match another identical geometry
Hi Hamid, Do you need the actual sequence of rotations around the x,y, and z axes, or do you just need a 3x3 matrix that gets...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
How can I get a Fourier-limited Gaussian pulse
Hi Andi, The issue here is that for a voltage pulse the fourier transform is done on the linear voltage function y(t) to prod...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
How to obtain RGB triplet of scatter points from the colorbar in scatter plot
Hello Nam Tran, I believe this is done in the following way, assuming a colormap of size 64x3 and that c is provided: cm...

presque 8 ans il y a | 0

Réponse apportée
(a + b) + c ≠ a + (b + c)
Hi peluca6, try 0.1 0.2 0.3 These situations are not hard to find. If you just take three random floating point numbers...

presque 8 ans il y a | 2

| A accepté

Réponse apportée
How can I create paths relative to a specific folder to facilitate moving project folders to other locations?
Hi Adriel, Here's one approach, concatenation % give the path a short name, the idea is on the computer you only have to...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
mod(a,b) floating-point rounding error
Hi Jeff, This is definitely a floating point issue. After running the code, x(3,121) -.2 ans = -5.551115123125783e-1...

presque 8 ans il y a | 0

Réponse apportée
Writing a complicated equation in
Hello Rebeca, Matlab does have a lambertw function, so you can use it to solve this. First of all, since b is known, one c...

presque 8 ans il y a | 0

Réponse apportée
Semipositive definite matrix for quadratic term has a convex quadratic fucntion
Hi J.J. m = [0 0;1 2]; x = [-3;1]; >> x'*m*x ans = -1 positive semidefinite? no. A matrix is positive semi...

presque 8 ans il y a | 0

Réponse apportée
how to rotate coordiante system about Z axis first then rotate about about the new Y axis.
Hi Yang, Suppose you have rotation matrices Rx = [1 0 0 Ry = [c 0 -s Rz = [c -s 0 0 c -s 0 ...

presque 8 ans il y a | 0

| A accepté

Charger plus