Answered

Plotting the theoretical maximum possible efficiency of a heat engine

Hi Aidan, It's possible to fix up the for loop, but easier and much more in the spirit of Matlab to do this with vectors. Tl1=...

Plotting the theoretical maximum possible efficiency of a heat engine

Hi Aidan, It's possible to fix up the for loop, but easier and much more in the spirit of Matlab to do this with vectors. Tl1=...

5 months ago | 0

Answered

Compute wave energy converter power output using power matrix

Hi Ross, For the matrices SWH and T02, which I will call S and T, do they already meet the condition S contains integers from ...

Compute wave energy converter power output using power matrix

Hi Ross, For the matrices SWH and T02, which I will call S and T, do they already meet the condition S contains integers from ...

5 months ago | 0

Answered

Finding PSD from Autocorrelation, FFT, Periodogram and Pwelch

Hello YK, Since you are using ffts, the appropriate correlation is going to be circular correlation. This can be done by using...

Finding PSD from Autocorrelation, FFT, Periodogram and Pwelch

Hello YK, Since you are using ffts, the appropriate correlation is going to be circular correlation. This can be done by using...

5 months ago | 1

| accepted

Answered

is there any method to apply the for loop in this, I caN't see any pattern please help in this

Hi Sahil, This can be done by for loop but it is maybe better to do the whole thing with index manipulation. In the written-ou...

is there any method to apply the for loop in this, I caN't see any pattern please help in this

Hi Sahil, This can be done by for loop but it is maybe better to do the whole thing with index manipulation. In the written-ou...

5 months ago | 0

| accepted

Answered

How can I show Electric Potential due to a Dipole as a 3D surface?

Hi Luca, Since you can't show the values of the potential at every point in the 3d space, this is most commonly done by showing...

How can I show Electric Potential due to a Dipole as a 3D surface?

Hi Luca, Since you can't show the values of the potential at every point in the 3d space, this is most commonly done by showing...

5 months ago | 0

Answered

What is the equation used for taylor window function 'taylorwin'

Hi Palguna, The equations are in the attachment. rect(t) is a rectagle function, = 1 for -1/2<= t <= 1/2, 0 otherwise. That's...

What is the equation used for taylor window function 'taylorwin'

Hi Palguna, The equations are in the attachment. rect(t) is a rectagle function, = 1 for -1/2<= t <= 1/2, 0 otherwise. That's...

6 months ago | 2

| accepted

Answered

Explanation for a function within xcorr

Hi big, rather than puzzle this out in place, it seemed easier to look at the output of the function for the first hundred valu...

Explanation for a function within xcorr

Hi big, rather than puzzle this out in place, it seemed easier to look at the output of the function for the first hundred valu...

6 months ago | 0

| accepted

Answered

Got wrong normal vector

Hi AC, You were quite right in your suspicions of the 3d plot, which looks fishy. You might call this a configuration control ...

Got wrong normal vector

Hi AC, You were quite right in your suspicions of the 3d plot, which looks fishy. You might call this a configuration control ...

6 months ago | 0

| accepted

Answered

fft vs nufft- scaling

Hi Nathan, In the fft case you are dividing by N = 1500 and multiplying by 2. For nufft you aren't doing that. Hence the fact...

fft vs nufft- scaling

Hi Nathan, In the fft case you are dividing by N = 1500 and multiplying by 2. For nufft you aren't doing that. Hence the fact...

6 months ago | 0

| accepted

Answered

Why I got the dominant frequency as 1/time when I running fft?

Hi CS, here is an example, first with 800 points, then 400 points. The frequency scale is constructed differently in each one ...

Why I got the dominant frequency as 1/time when I running fft?

Hi CS, here is an example, first with 800 points, then 400 points. The frequency scale is constructed differently in each one ...

6 months ago | 0

Answered

finding the orthogonal vectors for a series of vectors

Hi Pouya, Here is another method, somewhat related to Bruno's a = 2*rand(1000,3)-1; m1 = tril(ones(3,3)) -triu(ones(3,3)) ...

finding the orthogonal vectors for a series of vectors

Hi Pouya, Here is another method, somewhat related to Bruno's a = 2*rand(1000,3)-1; m1 = tril(ones(3,3)) -triu(ones(3,3)) ...

6 months ago | 1

Answered

spline for corner object

HI Mehri, try sorting by angle around a point in the center: x0 = 350; y0 = 325; theta = atan2(y-y0,x-x0); [~,ind] = sort(t...

spline for corner object

HI Mehri, try sorting by angle around a point in the center: x0 = 350; y0 = 325; theta = atan2(y-y0,x-x0); [~,ind] = sort(t...

6 months ago | 1

Answered

I want to solve this couple differential where the dot represent the derivative with respect to t/tp, where tp = 30E-9, is my code for solving this is correct? ?

Hi Sahil, Since the constants are all of order 10^-3 to 10^3 or so, it's evident that normalized units are in play. So you hav...

I want to solve this couple differential where the dot represent the derivative with respect to t/tp, where tp = 30E-9, is my code for solving this is correct? ?

Hi Sahil, Since the constants are all of order 10^-3 to 10^3 or so, it's evident that normalized units are in play. So you hav...

6 months ago | 0

Answered

Write a vectorial function from a scalar function

Hi Giuseppi, it looks like you intend, in this case, f = @(z,y) z.^2 + y^2 Here .^ gives the element-by-element square of z, ...

Write a vectorial function from a scalar function

Hi Giuseppi, it looks like you intend, in this case, f = @(z,y) z.^2 + y^2 Here .^ gives the element-by-element square of z, ...

6 months ago | 0

Answered

What is the use case for ifft's trailing zero padding? Why is that the default?

Hi Kevin. Zeropaddinig has consequences. It also has its uses, but sometimes the results are unexpected. First of all, whatev...

What is the use case for ifft's trailing zero padding? Why is that the default?

Hi Kevin. Zeropaddinig has consequences. It also has its uses, but sometimes the results are unexpected. First of all, whatev...

7 months ago | 1

Answered

Why is it giving me undefined function for the slope field?

Hello Brenda, As an alternative to figuring out how to get that code up and running, or as a comparison, you can run your own c...

Why is it giving me undefined function for the slope field?

Hello Brenda, As an alternative to figuring out how to get that code up and running, or as a comparison, you can run your own c...

7 months ago | 0

Answered

How to code this quadratic minimization problem subject to a linear constraint?

Hi Armando/Bianca Suppose lambda is a 1x3 row vector. The code below is based on the fact that the solution abc (which is the ...

How to code this quadratic minimization problem subject to a linear constraint?

Hi Armando/Bianca Suppose lambda is a 1x3 row vector. The code below is based on the fact that the solution abc (which is the ...

7 months ago | 0

Answered

Interpolation of the values of points on the surface created by convex hull

Hi Jose/Nima, Suppose you have a triangle with vertex points p1, p2, p3, each of those defined by a column vector of their x,y,...

Interpolation of the values of points on the surface created by convex hull

Hi Jose/Nima, Suppose you have a triangle with vertex points p1, p2, p3, each of those defined by a column vector of their x,y,...

7 months ago | 0

Answered

generate white gaussian noise

Hi HL, Since white gaussian noise is just random draws from a normal distribution, you don't really need some toolbox or other,...

generate white gaussian noise

Hi HL, Since white gaussian noise is just random draws from a normal distribution, you don't really need some toolbox or other,...

7 months ago | 0

| accepted

Answered

Signal compensation of Time signal via FFT and cable loss frequency spectrum

Hi Michael, Although the Nyquist frequency is N/(2*delta_t), you have to consider both positive and negative frequencies. Assu...

Signal compensation of Time signal via FFT and cable loss frequency spectrum

Hi Michael, Although the Nyquist frequency is N/(2*delta_t), you have to consider both positive and negative frequencies. Assu...

7 months ago | 0

Answered

calculation code of PSD using fft

Hi DK, Since you are after power spectral density, and not the spectrum of the linear quantity fft(x), this means the square of...

calculation code of PSD using fft

Hi DK, Since you are after power spectral density, and not the spectrum of the linear quantity fft(x), this means the square of...

7 months ago | 0

Answered

precision of double variables

Hi Arda, you pretty much answered the question by mentioning precision. Most floating point numbers are not represented exactl...

precision of double variables

Hi Arda, you pretty much answered the question by mentioning precision. Most floating point numbers are not represented exactl...

8 months ago | 1

Answered

My code is giving only one solution to a function although there are two solutions, what can I do to get all the solutions?

Hi JN, syms x; assume(x,'positive') and proceed as before for the second one. It is not a great idea to use 'roots' as the n...

My code is giving only one solution to a function although there are two solutions, what can I do to get all the solutions?

Hi JN, syms x; assume(x,'positive') and proceed as before for the second one. It is not a great idea to use 'roots' as the n...

8 months ago | 1

| accepted

Answered

plotting T-U diagram using XSteam

Hi Aldan, the code is running through all the values, but it's not saving any of them. You need to do something like m = 220;...

plotting T-U diagram using XSteam

Hi Aldan, the code is running through all the values, but it's not saving any of them. You need to do something like m = 220;...

8 months ago | 1

| accepted

Answered

I want to highlight the curve of intersection of the sphare and the plane x+y+z=0 by a thick blue curve. How to do that?

Hi Atom, Your code doesn't work because if you multiply out X2^2 + Y2^2 + Z2^2, you don't get R^2. So that arc is not on the s...

I want to highlight the curve of intersection of the sphare and the plane x+y+z=0 by a thick blue curve. How to do that?

Hi Atom, Your code doesn't work because if you multiply out X2^2 + Y2^2 + Z2^2, you don't get R^2. So that arc is not on the s...

8 months ago | 0

| accepted

Answered

How can I change this explicit method code to the implicit method code?

Hi MC I am not sure what is meant by 'implicit method', and while numerical methods are good, there is also the exact expressio...

How can I change this explicit method code to the implicit method code?

Hi MC I am not sure what is meant by 'implicit method', and while numerical methods are good, there is also the exact expressio...

8 months ago | 0

Answered

How to plot the magnitude and the phase of this function f(1/z)=(0.5 + 000i)*z^(−1 )+ (0.2500 − 0.4330i)*z^(−2) + (−0.2500 − 0.4330i)*z^(−3)?

Hello Aisha, technically this equation should read f(z)=(0.5 + 000i)*z.^(−1 )+ (0.2500 − 0.4330i)*z.^(−2) + (−0.2500 − 0.4330i...

How to plot the magnitude and the phase of this function f(1/z)=(0.5 + 000i)*z^(−1 )+ (0.2500 − 0.4330i)*z^(−2) + (−0.2500 − 0.4330i)*z^(−3)?

Hello Aisha, technically this equation should read f(z)=(0.5 + 000i)*z.^(−1 )+ (0.2500 − 0.4330i)*z.^(−2) + (−0.2500 − 0.4330i...

8 months ago | 0

| accepted

Answered

How to Plot Ramsey Phase Plane

HI ec, There are a couple of issues here. First, the cdot expression lacks a dot, should be k.^(alpha-1). Second, the grid ...

How to Plot Ramsey Phase Plane

HI ec, There are a couple of issues here. First, the cdot expression lacks a dot, should be k.^(alpha-1). Second, the grid ...

9 months ago | 0

| accepted

Answered

How the plot of the phase of the complex function look likes BY USING THE MATLAB?

Hi Aisha, Taking the second part first, a phase angle can be either positive or negative. The Matlab angle function uses the u...

How the plot of the phase of the complex function look likes BY USING THE MATLAB?

Hi Aisha, Taking the second part first, a phase angle can be either positive or negative. The Matlab angle function uses the u...

9 months ago | 0

| accepted

Answered

Analytical solution for 1D heat equation

Hi Dominick, you have the sum of two sine terms for the boundary condition, sin(x) and (1/10) sin(10x). So consider a general ...

Analytical solution for 1D heat equation

Hi Dominick, you have the sum of two sine terms for the boundary condition, sin(x) and (1/10) sin(10x). So consider a general ...

9 months ago | 0

| accepted