Answered
Quad Function Error for Integrals
Hello Adriel, you are missing some dots to make element-by-element division and exponentiation happen y1 = quad('x.^2 +2*x...

9 years ago | 1

| accepted

Answered
Relative position of a point with respect to centroid
Hello Blue The relative position is the coordinates of the point in question minus the 'with respect to' point which in this ca...

9 years ago | 0

Answered
How to find eigenvalues of problem that dont have the form of standard eigenvalue problem?
Hi Mehdi, I can't address whether there would be a successful solution, and there may well be better algorithms available now t...

9 years ago | 0

| accepted

Answered
matrix manipulation : ind of wanted rows and columns stocked in a vector
Hi Lila, you just have to make an index vector: B = [1 3]; C = A(B,B) The row index is the first listed and the col...

9 years ago | 0

Answered
Continuous convolution and the (inverse) FFT
Hi Thomas, I started out with the continuous transform as well, so going to the discrete form took some getting used to. The b...

9 years ago | 0

| accepted

Answered
Solving system of equations with three unknowns?
Hi Jason, there seems to be something funny about these equations. If you eliminate V from the first two, you can show that Re*...

9 years ago | 0

Answered
Is there a way to remove the nested for loops from this segment of code? I'm trying to make the code generic so it can take in n-number of moment arrays.
Hello Joseph, I believe this does what you want. It assumes you have a 3d array called momentarray, containing an arbitrary nu...

9 years ago | 0

| accepted

Answered
how to plot sigmoid activation curve for sodium channel
Hello best16, I am certainly no expert but I believe it's the _conductance_ that has a sigmoid curve vs. voltage. A plot of pe...

9 years ago | 0

Answered
"expression to the left of the equals sign is not a valid target" error
Hello Audrey, I believe the problem is actually on the preceding line where you are missing a square parenthesis ] at the end of...

9 years ago | 0

| accepted

Answered
add nans so all arrays in 3d matrix have same dimensions
Hi m, To make each of them 60 columns, for example: nrows = size(m,2); m(:,nrows+1:60)= nan;

9 years ago | 0

Answered
Unexpected complex coefficients in a matrix
Hello Javier, The only opportunity here to get a complex number is if the argument of the log term is negative. For all the no...

9 years ago | 1

| accepted

Answered
conversion of binary to decimal
Hi ablaze, Your code has bin2dec trying to convert a string containing the word 'binary'. Try a = '1011' bin2dec(a)

9 years ago | 0

| accepted

Answered
Removed how do i
Hi jay, It looks like I is giving you the number of columns and J the number of rows. But i is your row index and j is your co...

9 years ago | 1

| accepted

Answered
Geodetic to cartesian coordinates
Hello Benedict, (revised) The four points do form a pretty good rectangle, but it doesn't look like it because the x and y a...

9 years ago | 1

| accepted

Answered
How do I find the x values at the point of intercept between two quadratic functions numerically?
Hello V, Or, you could simply do A1 = [a1 b1 c1]; % for a1 x^2 + b1 x + c1 A2 = [a2 b2 c2]; % for a...

9 years ago | 1

Answered
Unwrap with tolerance other than default (=pi)
Hello pSchi, from 'doc unwrap': Note A jump tolerance less than π has the same effect as a tolerance of π. For a tolerance ...

9 years ago | 0

| accepted

Answered
Sorting an n x n matrix in the Jordan form.
Hello Mohammad, I believe the following code works for a given Jordan matrix J. a = sort(diag(J),'descend'); d = diff(a...

9 years ago | 0

Answered
Seeking guidance in log scaled colorbar display error
Hi AMart, It appears that the problem is, since log(0) = -inf, you are effectively saying caxis([-inf, log10(1.5)]). If you c...

9 years ago | 0

| accepted

Answered
Solving the generalized eigenvalue problem A*V = B*V*D with A and B being Hermitian gives COMPLEX eigenvalues.
Hello Jen-Hao, What is your source of information that the general eigenvalue problem for Hermitian A,B has real eigenvalues? ...

9 years ago | 0

Answered
The easiest way to add a line of determined slope to a loglog
Hello Ivan, A straight line of slope -5/3 on a loglog plot has the form log(y) = (-5/3)*log(x) + b with an arbitrary constant b...

9 years ago | 1

| accepted

Answered
How to vectorize this function?
Hello Quinten, a standard way to do this is to make a vector of zeros the same length as 'position', then make a logical index v...

9 years ago | 0

Answered
Physically correct Normalization of fft + Implementing Parseval's Theorem
Hello fgb Here is a revised answer that attempts to better address the issue. I believe there are a couple of things going o...

9 years ago | 2

| accepted

Answered
How to do numerical integration using Matlab and how to plot it?
Hi Deema, (Having looked at and benefited from the comments so far I will take this answer in a slightly different direction). ...

9 years ago | 0

Answered
Predicting initial angle of projectile
Hello Swera, what you show here is actually not so bad, except that your range of angles is a lot more than you need. If the out...

9 years ago | 1

| accepted

Answered
Summation Using For Loop
Hi vaninea, Don't forget that you are calculating pi^3/32, not pi! Espi equals (appoximately) pi^3/32, so you need to work bac...

9 years ago | 0

| accepted

Answered
Help with Method of Moments, Surface Charge on Plate
Hi Matthew, I believe the basic problem has to do with the representation of voltage and charge. You have a 10x10 grid of poin...

9 years ago | 2

| accepted

Answered
MATLAB- ifft of simple lowpass filter returns NaN
Hello Nathan, I believe the problem is because the frequency grid contains the point f=0, and your expression for tf comes up w...

9 years ago | 1

| accepted

Answered
Ripples in Fourier Transform
Hi Aman, You don't say what your x array was, but I believe the effect occurs because that array has finite width and cuts of...

9 years ago | 0

| accepted

Answered
Recursive loops in MATLAB
Hi Ricardo, here is a method using a function I created recently that is related to the adjustable-dimension issue. This is th...

9 years ago | 0

| accepted

Answered
fsolve Finite difference - Problem: "indices must either be real positive integers or logicals"
Hi Max, You did not mention where in the code the error occurred, but certainly you will get such an error with for j=1:N-...

9 years ago | 0

| accepted

Load more