Answered

How to use function toi with GHz frequency?

Hi Raul The problem is that you have 32 Hz as a sampling frequency. I assume here that you meant 32GHz. If you look at the ti...

How to use function toi with GHz frequency?

Hi Raul The problem is that you have 32 Hz as a sampling frequency. I assume here that you meant 32GHz. If you look at the ti...

1 month ago | 0

| accepted

Answered

Checking values in a vector

Hello Jose if any(x(4:end)~=0) (do something) else (do something else) end

Checking values in a vector

Hello Jose if any(x(4:end)~=0) (do something) else (do something else) end

1 month ago | 0

| accepted

Answered

solve equation whit integer output as a matrix

Hi Simon, you have z2/z1 = 3.9 % or 10*z2 = 39*z1 since 10 and 39 are relatively prime, i.e. they have no prime factors in...

solve equation whit integer output as a matrix

Hi Simon, you have z2/z1 = 3.9 % or 10*z2 = 39*z1 since 10 and 39 are relatively prime, i.e. they have no prime factors in...

1 month ago | 0

Answered

How to solve a differential equation and the plug a number in for the resulting differential equation

Hi Benjamin, syms x d = diff((1 + 5 * x^2 - 2 * x^3 + 8 * x^4) ^(1/8)) x0 = 8.8 val = double(subs(d,x0)) val = 0.2...

How to solve a differential equation and the plug a number in for the resulting differential equation

Hi Benjamin, syms x d = diff((1 + 5 * x^2 - 2 * x^3 + 8 * x^4) ^(1/8)) x0 = 8.8 val = double(subs(d,x0)) val = 0.2...

1 month ago | 0

Answered

System of nonlinear equations

Hi Aleem, Wolfram Alpha is solving this numercially not analytiaclly so you might as well, too. b = @(t) 10*cosd(15)*(t+ 2*(4...

System of nonlinear equations

Hi Aleem, Wolfram Alpha is solving this numercially not analytiaclly so you might as well, too. b = @(t) 10*cosd(15)*(t+ 2*(4...

2 months ago | 1

| accepted

Answered

My diff function won't work and I'm not sure why

Hi Julia, if you want to use this for a variety of functions, then fun = @(x) exp(2*sin(x)) - x; % one example [f g ...

My diff function won't work and I'm not sure why

Hi Julia, if you want to use this for a variety of functions, then fun = @(x) exp(2*sin(x)) - x; % one example [f g ...

2 months ago | 0

Answered

How to implement polyval in more than one dimension when the summation includes complex coefficients

Hi Matthew, unless I'm missing something, % make up some data M = 5; N = 6; c = rand(N,M)+i*rand(N,M); eps = .3; delt = ...

How to implement polyval in more than one dimension when the summation includes complex coefficients

Hi Matthew, unless I'm missing something, % make up some data M = 5; N = 6; c = rand(N,M)+i*rand(N,M); eps = .3; delt = ...

2 months ago | 0

Answered

How can I make curve form data?

Riyadh; The differences from a straight line are small, so it make sense to look at that difference. x = [7000,7050,7100,7150,...

How can I make curve form data?

Riyadh; The differences from a straight line are small, so it make sense to look at that difference. x = [7000,7050,7100,7150,...

2 months ago | 0

Answered

Does fftn do post padding ?

HI raheem, It's pre padding of the original x array by 56 in each dimension, before the fft. As you can see, the y array has n...

Does fftn do post padding ?

HI raheem, It's pre padding of the original x array by 56 in each dimension, before the fft. As you can see, the y array has n...

2 months ago | 0

Answered

Compute the difference matix between a marix and another matrix in MATLAB

Hello Jesujoba, it looks like A and B must have the same number of columns but can have a different number of rows. The for-lo...

Compute the difference matix between a marix and another matrix in MATLAB

Hello Jesujoba, it looks like A and B must have the same number of columns but can have a different number of rows. The for-lo...

2 months ago | 0

| accepted

Answered

Problem Using Summation Notation with Euler's Number

Hi Jonathan, symbolics is just telling you that it can't do the sum explicitly and get an analytic solution. Fortunately the t...

Problem Using Summation Notation with Euler's Number

Hi Jonathan, symbolics is just telling you that it can't do the sum explicitly and get an analytic solution. Fortunately the t...

2 months ago | 0

| accepted

Answered

Problem in 2 dimensional numerical integration

Hi Ashok, you can make a decent case that the answer is 1/2, at least if the variables are continuous. For the first term, In...

Problem in 2 dimensional numerical integration

Hi Ashok, you can make a decent case that the answer is 1/2, at least if the variables are continuous. For the first term, In...

2 months ago | 0

Answered

Bessel function - roots and zeros on interval <12,20>

HI Jaroslav Do roots and zeros mean the same thing? The code below uses Newton's method to find the roots, which has the advan...

Bessel function - roots and zeros on interval <12,20>

HI Jaroslav Do roots and zeros mean the same thing? The code below uses Newton's method to find the roots, which has the advan...

2 months ago | 0

Answered

3D vector plot of electric field

Hello QP, Once you have made the matrix variables XX,YY,ZZ, those are the ones you use for further calculation, no longer x,y,z...

3D vector plot of electric field

Hello QP, Once you have made the matrix variables XX,YY,ZZ, those are the ones you use for further calculation, no longer x,y,z...

2 months ago | 0

Answered

Plotting a matrix of co-ordinates

Hi Anmoi, points = rand(2,56) plot(points(1,:),points(2,:),'o') grid on If you go to the help for plot you will find many ot...

Plotting a matrix of co-ordinates

Hi Anmoi, points = rand(2,56) plot(points(1,:),points(2,:),'o') grid on If you go to the help for plot you will find many ot...

2 months ago | 1

| accepted

Answered

Matrix division problem on adding condition

Hi David, MODIFIED the solution is not immediate, but you did ask … Take the example A = [1 2 3] C = [5 2 -1] B = the matr...

Matrix division problem on adding condition

Hi David, MODIFIED the solution is not immediate, but you did ask … Take the example A = [1 2 3] C = [5 2 -1] B = the matr...

2 months ago | 2

| accepted

Answered

Evaluating svd() on slice of matrix array.

Hi Morten I take it that your matrices are close to being orthonomal already. Try [Q, ~] = qr(A(:,:,i)); A(:,:,i) = Q; whic...

Evaluating svd() on slice of matrix array.

Hi Morten I take it that your matrices are close to being orthonomal already. Try [Q, ~] = qr(A(:,:,i)); A(:,:,i) = Q; whic...

2 months ago | 0

Answered

How to solve a system of linear equations with strict inequalities and equalities?

Hi Terri, Looks like it is not possible. You have [F1;F2;F3] = [10 2 10 15 20 8 6 4 12] * [x1;...

How to solve a system of linear equations with strict inequalities and equalities?

Hi Terri, Looks like it is not possible. You have [F1;F2;F3] = [10 2 10 15 20 8 6 4 12] * [x1;...

2 months ago | 0

| accepted

Answered

How can I solve for the matrix S in the below mentioned matrix equation?

Hello NAA, It appears that you mean that d is 3x6,not 6x3. Let E = EPS_T - EPS_S and abbreviate inv(S) as iS. You are looki...

How can I solve for the matrix S in the below mentioned matrix equation?

Hello NAA, It appears that you mean that d is 3x6,not 6x3. Let E = EPS_T - EPS_S and abbreviate inv(S) as iS. You are looki...

2 months ago | 1

| accepted

Answered

How do i scale to my axis after fft?

Hi Cherie, you have a time array of length, 601 and spacing deltat = .01. The frequency array is going to be 601 points with t...

How do i scale to my axis after fft?

Hi Cherie, you have a time array of length, 601 and spacing deltat = .01. The frequency array is going to be 601 points with t...

2 months ago | 1

| accepted

Answered

Raise the elements of a matrix to a power.

Hi Ricardo, min3 = min.^3 It's not a good idea to name a variable 'min' because that is the name of a built-in Matlab function...

Raise the elements of a matrix to a power.

Hi Ricardo, min3 = min.^3 It's not a good idea to name a variable 'min' because that is the name of a built-in Matlab function...

2 months ago | 1

| accepted

Answered

Solving an equation with terms that require double summation and products

Hi GS, I reproduced your results and then calculated the equation using for loops, just to make sure, and got 1.8767e37, same a...

Solving an equation with terms that require double summation and products

Hi GS, I reproduced your results and then calculated the equation using for loops, just to make sure, and got 1.8767e37, same a...

2 months ago | 0

| accepted

Answered

Solving an equation with terms that require double summation and products

Hi GS, try aij_2 = aij.^2 Since y1 and y2 are scalars, there are three dots in the last equation that you can drop. I usuall...

Solving an equation with terms that require double summation and products

Hi GS, try aij_2 = aij.^2 Since y1 and y2 are scalars, there are three dots in the last equation that you can drop. I usuall...

2 months ago | 0

Answered

How to plot double sided amplitude spectrum after FFT?

Hi Hamid, at the end of your code I added the following: figure(2) plot(f,fftshift(cmag),'o'); grid on xlim([-30 30]); f...

How to plot double sided amplitude spectrum after FFT?

Hi Hamid, at the end of your code I added the following: figure(2) plot(f,fftshift(cmag),'o'); grid on xlim([-30 30]); f...

2 months ago | 0

| accepted

Answered

Why are the symbolic units not evaluated by a square root?

Hi Lucas, try your original code but with the last two lines omega_n = (pi/l)^2*(g*E*I/(A*lambda))^(1/2) omega_n = vpa(simpli...

Why are the symbolic units not evaluated by a square root?

Hi Lucas, try your original code but with the last two lines omega_n = (pi/l)^2*(g*E*I/(A*lambda))^(1/2) omega_n = vpa(simpli...

3 months ago | 0

Answered

how to calculate direction in rotated coordinate system

Hi UWM, Assuming the correct rotation has already been made, then calling the resulting vector u, and making sure it is normali...

how to calculate direction in rotated coordinate system

Hi UWM, Assuming the correct rotation has already been made, then calling the resulting vector u, and making sure it is normali...

3 months ago | 0

| accepted

Answered

Why did i get different answers for eigenvectors for different powers of a matrix?

Hi RMT, Since you have two identical eigenvalues, the eigenvectors corresponding to those eigenvalues are not unique*. They on...

Why did i get different answers for eigenvectors for different powers of a matrix?

Hi RMT, Since you have two identical eigenvalues, the eigenvectors corresponding to those eigenvalues are not unique*. They on...

3 months ago | 1

| accepted

Answered

Element-Wise Vector Division

HI Mark, new_vector = K./vector; ./ (dot divide) does element-by-element operations.

Element-Wise Vector Division

HI Mark, new_vector = K./vector; ./ (dot divide) does element-by-element operations.

3 months ago | 1

| accepted

Answered

Vectorizing the addition of a vector of values with associated indices to an existing vector, when the vector of indices has repeated values.

Hi Nathan, sparse matrices automatically do what you want. You have full matrices, and sparse operations are on the slow side ...

Vectorizing the addition of a vector of values with associated indices to an existing vector, when the vector of indices has repeated values.

Hi Nathan, sparse matrices automatically do what you want. You have full matrices, and sparse operations are on the slow side ...

3 months ago | 0

| accepted

Answered

Sub-sampling the minimum number of points to accurately reproduce a curve

Hi Michael, take a look at the interp1 function. There are several choices for the type of interpolation, and assuming a curve ...

Sub-sampling the minimum number of points to accurately reproduce a curve

Hi Michael, take a look at the interp1 function. There are several choices for the type of interpolation, and assuming a curve ...

3 months ago | 0