Community Profile

photo

John D'Errico


Retired

4.284 total contributions since 2006

Mainly retired from Eastman Kodak. (Of course, Kodak itself is now semi-retired. I don't think I had any influence in that.) I still write MATLAB code as I find something interesting, and I do attempt to write new tools to put on the File Exchange when I think I can make a contribution.

However, I DON'T answer direct e-mail questions, and I do NOT do homework. In general, your homework is YOUR problem, not mine. Please do NOT e-mail me with your homework problems or student projects. If I was willing to answer your questions, I would very rapidly become overwhelmed, because one question is never just one simple question.

When I'm not doing something with MATLAB, you might find me playing bridge, either in the club or online on BBO.

Professional Interests: MATLAB, numerical analysis, mathematical modeling

Avocational interests: Bridge, woodworking, woodturning

Contact

John D'Errico's Badges

  • Master
  • Revival Level 3
  • 36 Month Streak
  • Thankful Level 4
  • Knowledgeable Level 4
  • First Answer
  • Promoter
  • Speed Demon
  • CUP Challenge Master
  • Creator
  • Commenter
  • Solver

View details...

Contributions in
View by

Answered
Simulating a Markov chain
There seems to be many followup questions, it may be worth discussing the problem in some depth, how you might attack it in MATL...

ein Tag ago | 1

Answered
How to use polyfit to get the difference out of two functions?
Polynomials are linear in the coefficients. So the difference of two polynomials is obtained by just subtracting the coefficient...

ein Tag ago | 1

Answered
random deployment of nodes
I don't see the problem. You don't start by solving the entire problem in one line of code. You start by going as slowly as you ...

2 Tage ago | 0

Answered
if condition for infinity
You cannot test for the word 'finite', and expect it to return a valid result, when compared to an inf value. x = inf x = ...

3 Tage ago | 0

Answered
Sum of a 4D matrix
The problem is a relatively easy one, as long as the total sum does not exceed 1. It gets nasty above that. I'll look at the pr...

5 Tage ago | 1

Answered
Linear Programming With geq constraints
You switch the sign of a constraint simply by multiplying everything by -1. I thought that was like elementary school math. Did ...

6 Tage ago | 0

| accepted

Answered
How to create a spline for data without sorting?
I can certainly do it with interparc. But it gets tricky, because interparc is set up to find points that are designated in term...

6 Tage ago | 1

| accepted

Answered
How can I reverse C = mpower(A,B)
Um, you can't. Information tossed into the bit bucket is irretrievably lost. In your example, A1 is upper triangular, with 0 on...

7 Tage ago | 0

| accepted

Answered
Extract rectangular grid from triangulation
The simple answer is to just round the points to a lattice. That is, just assign each point to the nearest lattice point. Since ...

7 Tage ago | 0

Answered
non linear equation with single root
fzero does not find a root, cannot find it, because it has no zero crossing. That is a requirement for fzero. Effectively, there...

7 Tage ago | 1

| accepted

Answered
Curve Fitting Equation result
Those are approximate confidence limits on the variable as estimated. (Not always very good limits, as I said, approximate.) I...

8 Tage ago | 0

| accepted

Answered
coefficients of the polynomial - the least squares method
Sort of correct. But I see at least two subtle problems. First, you have 9 data points. So a polynomial with as many coefficien...

9 Tage ago | 0

| accepted

Answered
excel linear regression trouble vs excel linear regression
Simple enough. polyfit(x,y,1) ans = -0.002965 1.7919 Or: regress(y',[x',ones(length(x),1)]) ans = -0.002965...

10 Tage ago | 0

Answered
Solving linear equations with large matrices
Enough information now that I'll hazard an answer. By the way, the logic behind suggesting GMRES is NOT that your matrix is spa...

10 Tage ago | 1

| accepted

Answered
Why is the answer from the calculator and matlab different?
Because 455^100 is a computation done in DOUBLE PRECISION. Assuch, it goes well beyond the limits of what a double can represent...

11 Tage ago | 1

Answered
How to solve an equation, with infinite solutions, to find only n number of solutions?
Provably getting the FIRST 5 solutions is essentially impossible on a completely general function, as it is trivial to write a f...

12 Tage ago | 0

Answered
Solving system of n equations
syms a x b y EQ = y == a*x + b; isolate(EQ,x) ans = x == -(b - y)/a

12 Tage ago | 0

Answered
How do I create a repeating number series?
LEARN TO USE MATLAB. 0.25:.5:25 ans = Columns 1 through 11 0.25 0.75 1.25 1.75 2...

12 Tage ago | 0

| accepted

Answered
interpolation of scatter data
First, your original contour plot. Next, the interpolated one. So much noisier. Interpolation does not necessarily make th...

12 Tage ago | 0

| accepted

Answered
How to Solve Non-Linear Equation with changing coefficient
Note there is no need to use fzero. Roots is entirely adequate, and more accurate. Roots also recognizes there are TWO real solu...

13 Tage ago | 2

Answered
Interp1 command, wrong number of input arguments
Read the help for interp1. With 4 input arguments: Vq = interp1(X,V,Xq,METHOD) specifies the interpolation method. The a...

13 Tage ago | 0

Answered
how to make 2d lookup table when having 3 vectors
The problem is, your data is insufficient to create a 2-d surface from only that data. (Yes, you CAN use a scatteredInterpolant,...

13 Tage ago | 0

Answered
Numerical solution of a matlab function.
This is just a continuation of the last time the same question was asked, and answered. https://www.mathworks.com/matlabcentral...

14 Tage ago | 1

Answered
How do I test a vector element by element for imaginary elements
What does the function imag return? Given that, what would imag( r ) ~= 0 tell you? see that it returns a true or false valu...

14 Tage ago | 0

| accepted

Answered
Print all possible matrix combinations for a given matrix
You are going mad because ... Your problem is poorly formulated. i.e., how close to S/3 do you need to be? For long vectors, y...

14 Tage ago | 2

Answered
Finding pythagoras triples when only c is known
Alternatively... Talk to Euclid. An old guy, maybe even dead by now. He gave us a formula for Pythagorean triples. https://en....

14 Tage ago | 5

| accepted

Answered
How can I make magic matrix if I know the diagonal
Not all problems have a solution. But sometimes, they do, IF you are willing to relax some conditions. A classical magic square ...

15 Tage ago | 4

| accepted

Answered
does the query points in gridfit function need to start from zero?
No. There is no requirement about needing to start from zero. In fact, those were WARNINGS, not errors. It MAY indicate a proble...

15 Tage ago | 0

| accepted

Answered
Data point missing in if statement
Let me explain separately, since you are misssing the point. The important point is NOT that there are duplicated points at (5...

16 Tage ago | 0

| accepted

Answered
Locating a point along a curve some distance away from an initial point.
Easy, peasy. That is, assuming you are asking about a distance in terms of arclength along the curve. If not, then the answer is...

17 Tage ago | 1

| accepted

Load more