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

7 years ago | 2

| accepted

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

7 years ago | 0

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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 1

| accepted

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

7 years ago | 0

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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

Answered
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 = (...

7 years ago | 1

| accepted

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

7 years ago | 4

| accepted

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

7 years ago | 1

| accepted

Answered
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)

7 years ago | 2

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 2

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

| accepted

Answered
Radioactive Decay from Atom 1 to Atom 2 to Atom 3
Hi says, This is pretty close. In your expression for N_2, there is a misplaced right parenthesis. The factor in front is s...

7 years ago | 0

Load more