Answered
How to do LU factorization without permutation? The lu() is with permutation.
Hi Alvin Certainly you can do the decomposition without permutation, just not with Matlab lu. (Why you might want to is a diff...

1 year ago | 2

Answered
Period of a Linear Congruential Random Number Generator
HI William. If you're still listening, then if you are only interested in the period and not all of the values of x along the w...

1 year ago | 0

| accepted

Answered
Dot product of two vector
Hello Syazana syms c1 s1 n1 n2 n3 a1 a2 a3 real A = [c1 -s1 0; s1 c1 0; 0 0 1] A = [c1, -s1, 0] [s1, c1,...

1 year ago | 0

| accepted

Answered
Solve the integral in the point where the function is singular
Hi Dimani, Leaving out the first '1 ' term that has no singularity and leaving off some constants, you are basically looking at...

1 year ago | 0

Answered
How to generate a noise which sums up as zero?
Hi Ananta, noise=randn(1,64)*sqrt(0.001)*240 noise = noise - mean(noise); if you subtract off the mean, then the new sum of t...

1 year ago | 0

Answered
Trying to use modified secant method to solve for a theta over different g values.
Hi Carson, let b = g*d^2/(2*v^2) % a distance then your equation (multiplied by -1) is b/cos^2 - d*tan - y = 0 plug in ...

1 year ago | 0

Answered
I require frequency response from transfer function = 1/(s^2+(b/m)*s+k/m) where b= 0.0011, k= 87.88 , m = 0.99 in matlab and i need freq in khz
Hi sia, there is not much need to do any detailed calculation when your starting point is what it is. This system has a small a...

1 year ago | 0

Answered
Difference between 2 orientations
Hello Jonathan, You have two 3x3 rotation matrices, each expressed in terms of euler angles, Rrpha(:,1:3) = [cp.*ch, -sp, cp...

1 year ago | 0

Answered
Can't tell if exprnd is working correctly
Hi Umberto, I believe the issue happens because you are plotting the cumulative variables D1 and D2. Once the difference D1-D2...

1 year ago | 0

Answered
Raising a large sparse matrix to a large power
Hi if you are operating on 'a particular vector' v then you do not have to iterate as in m = m*m % iterate to form ...

1 year ago | 2

Answered
I’m thinking of make a command to change Hankel matrix into x time series
Hi Ahmed, here is one way y = magic(5) n = size(y,2); x = zeros(1,2*n-1); x(1:2:end) = diag(y).'; x(2:2:end) = diag(y,1)...

1 year ago | 0

Answered
How to find the width of a peak where there is no actual data, just individual points?
Hi Alfredo, Usually your ydata would be the frequency domain version of a linear quantity such as voltage or displacement. Hal...

1 year ago | 1

| accepted

Answered
why the simulation period is wrong about schrodinger equation in a harmonic potential
Hi Daniel, Nice animation. Looks like in your 'hamiltonian' function, the kinetic energy is missing a factor of 1/2. Changing...

1 year ago | 0

| accepted

Answered
Units for Thermal PDE thermalProperties Function
Hi Simon, The heat conduction equation is dT/dt = alpha (d^2/dx^2+d^2/dy^2+d^2/dz^2) T where alpha, the thermal diffusivity, ...

1 year ago | 0

| accepted

Answered
solve 4 equations with some unknown coefficients.
Hi Ahmad, If the answers don't have to match up with the paper, that makes things easier. I took four equations very similar t...

1 year ago | 0

Answered
looking for convenient way to extract matrix from 1*n*n
Hi YL, A=zeros(5,5,5) B=squeeze(sum(A,1)); Squeeze removes all singleton dimensions.

1 year ago | 0

Answered
xcorr lag input to time?
Hi Carly, lags is a dimensionless index, so it's in samples (it has to be samples since xcorr has no way of knowing what fs mig...

1 year ago | 0

| accepted

Answered
Most efficient way to put vector on the off-diagonal of the blocks of a block matrix
Hi David, MODIFIED see Dyuman's comment to sensibly shorten this original code. n = 4; v = [1 2 3 4 5 6 7 8 9 8 7 6]; % le...

1 year ago | 1

Answered
How can I create a random matrix without repeating any value between column
Hello Wan, all columns contain 1 through 4, and all columns are different a = perms(1:4) % all 24 permutations of 1:4 ...

1 year ago | 1

| accepted

Answered
recreating roots of a derivative of bessel funtion of first order
Hi fv, Here is a function for the first q zeros of both Jn(x) and dJn(x) /dx. As an example, to find the first 100 zeros of th...

1 year ago | 1

Answered
Picking Branch Cut of Square Root
Hi bil, Here is a function that does that job. It appears that you want to do the division (a-i)/(a+i) before taking the squar...

2 years ago | 2

| accepted

Answered
Find the nonzero maximum frequency corresponding to FFT graph.
Hi Zahra, the peak at zero frequency is because your signal does not have average value of zero, but has a DC offset. To elimi...

2 years ago | 0

| accepted

Answered
Find combination of 12 matrix rows, fulfilling certain criterion, from matrix of size 3432 *7
Hi Ernesto, Once you have a single 12x7 solution you can make many more by random element swapping of elements in that matrix. ...

2 years ago | 0

Answered
I know it is a redundant question, but i have no idea why solve keeps returning 0
Hello Andrei, First of all, all these expressions are functions of (x1-x2) and (y1-y2) only. That means if x1,x2,y1,y2 is a so...

2 years ago | 2

Answered
atanh of negative complex numbers
Hi Derek, For the troublesome subplot, try semilogx(f,unwrap(imag(2*x*gamma))/(2*x)) The idea is that the phase is proportion...

2 years ago | 0

| accepted

Answered
Solving systems of trig equations
Hi Jon, Here is one method. To come up with values of r and g that work, it appears to be easier to think in terms of R = r^2 ...

2 years ago | 1

Answered
Change the period/frequency of a Van der Pol Oscillator
Hi Alexis, If you want to preserve the shape you will have to have a larger set of parameters. I am taking as given your equa...

2 years ago | 0

| accepted

Answered
Cconditional subtraction of 2 vectors of different lengths
Hi salah, You can do quite a bit if the two vectors are sorted. Assume you have two sorted vectors sx and sy of length Nx and ...

2 years ago | 0

Answered
Get "Matrix is is singular to working precision" when attempting a global stiffness matrix with four nodes
Hi Declan, I am not sure how you are getting the error message. Running the code with k changed to K d(range) = K(range,range...

2 years ago | 1

| accepted

Answered
energy signal
Hi k.v. For a given real signal y(n) of length N, n = 1 to N, the power at any point n is y(n)^2, the average power P is Pave ...

2 years ago | 0

Load more