Community Profile

# David Goodmanson

### David Goodmanson

Last seen: Today Active since 2012

All

#### Content Feed

View by

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

3 días ago | 0

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

4 días ago | 0

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

6 días ago | 0

| accepted

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

6 días ago | 0

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

12 días ago | 0

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

17 días ago | 1

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

19 días ago | 1

| accepted

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

20 días ago | 0

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

24 días ago | 0

| accepted

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

27 días ago | 0

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

alrededor de 1 mes ago | 0

| accepted

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

alrededor de 2 meses ago | 0

| accepted

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

alrededor de 2 meses ago | 0

| accepted

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

alrededor de 2 meses ago | 0

| accepted

Why is 0 and 30 1/2?
Hi Alexander; This occurs because heaviside(-.3:.1:.3) ans = 0 0 0 0.5000 1.0000 1.0000 1.0000 ...

alrededor de 2 meses ago | 0

Difference between numerical and analytical solution of ode?
Hi IG, Here is an almost-analytical solution for x0 and x1 (which are called x and y respectively). It's analytic for x, uses ...

2 meses ago | 0

I want to plot an implicit equation
Hi mohd, This is not really an implicit equation since Vgs appears only once, by itself, on the lhs. So you can take all the o...

2 meses ago | 1

Circular Cross Correlation 2D Using FFT
Hi Ziv, yes, it works similarly. m = 5; n = 6; q = 4; A = randi(m,n,q); B = randi(m,n,q); C = zeros(size(A)); for j = 1:...

3 meses ago | 0

How to get coefficients for second degree polynomial with only two given boundary conditions (means with two equations but with three coefficients)?
Hi Ankit, x = [ 0 1 2 3]; E = [0 1 4.5 10.5]; c = polyfit(x,E,2) % fit a quadratic E1 = polyval(c,x) figure(1) plot(x,...

3 meses ago | 0

Is there any way to plot values that are exponent multiples of 10 as colorbar directly without having to take their log
Hi Mathan, The colorbars cover the same range in each case, but It's still apples and oranges. Consider the value 1e6 In log sp...

3 meses ago | 1

| accepted

Can anyone help me? How can I solve 4th order Ordinary differential equations (ODEs)?
Hi Jihweon, Fortunately the analytic solution is pretty straightforward. Denoting Sp by A, the A^-4 factor matches up with the...

3 meses ago | 1

| accepted

Getting complex value for real integration
Hi Mithun, One of the more straightforward methods is to forget about symbolics and just write down the solution for y. The el...

3 meses ago | 0

| accepted

finding the maxima/minima using lagrange mutlipliers
Hi Ikenna, Here is one way. If you plot the function on the ellipse th = linspace(0,2*pi,1000); xx = cos(th); yy = sin(th)/...

3 meses ago | 0

| accepted

Unitary matrix with non-orthogonal eigenvectors?
Hi Joshua, I believe this happens because W has at least one set of degenerate eigenvalues, and does not happen if all the eige...

3 meses ago | 0

Complex output after applying inverse fourier transform
Hi Brian, I beleive the result is due to asymmetric truncation of the image in the frequency domain. I am inferring that your ...

3 meses ago | 0

| accepted

Split array into subarrays
Hi David, if A is 200x1 the easiest way to do that is B = reshape(A,50,4) so now B is a matrix whose four columns are each 50...

3 meses ago | 1

How solve this problem in Matlab
Hi Davide, here is a method that uses one for loop instead of two: n = 5 m = 6 V = zeros(n,m); V(:,1) = 1:n; for k = 2:m ...

3 meses ago | 0

trigonometric equation solution help
Hi Giuseppe Although Matlab can't come up with an analytic solution with symbolics, you can still obtain a numerical solution t...

3 meses ago | 0