Community Profile


John D'Errico


4,526 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


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

why is my Fixed point iteration method only giving me first iteration. (i included info at the bottom of code and the next few iterations answers)
Think about it. Does p EVER change? Why not? How would you make it change? Inside the loop, we see only this: N=N+1; F=p; p...

8 hours ago | 0

Conversion to function_handle from double is not possible.
LOOK AT THE ERROR MESSAGE. Think about what it tells you. Error in RegulaFalsi_Mod (line 21) f(a) = (1/k)*f(a); What ...

19 hours ago | 1

optimization toolbox
The optimization toolbox has existed for MANY years before 2006. I had a copy in my 1988 release. (Back then, it was called a ve...

1 day ago | 1

Can PLSregress handle no intercept
It is NEVER a good idea to hack toolbox code. The exceptions are where you know enough to be able to write the modified algorit...

1 day ago | 0

How can I count the largest number of repeated numbers in a double?
First, this is NOT a double vector. 00000000101100000011110000110000 It might be a string. But if you tried to write that vec...

1 day ago | 1

A particular differential equation... why can't I solve it?
Easier than you might think to solve, even with pencil and paper. But sometimes a computer won't see the trick, at least, not wi...

2 days ago | 0

| accepted

could anyone help me to solve the issue
Easy enough. Just use setdiff. A=[2 3; 1 4; 2 4; 3 4]; That is, ... B = A; cind = [3 4]; for i ...

2 days ago | 0

Main diagonal operations problem
Easy enough, it seems. First, determine the diagonal elements. x = diag(rand(1,4)*.7 + .3); Next, you need to choose the other...

2 days ago | 2

The accuracy of cumtrapz (numerical integration)????
This is something covered in any basic class that talks about numerical methods. (And why are you using methods about which you ...

3 days ago | 2

| accepted

How to make a variable an even number?
If you just want to check if a variable X is an even number, then just check the value of mod(x,2). If the result is zero, then ...

3 days ago | 1

Fitting of raw data
You don't have any simple model that you can use, at least, you have not suggested any. And, even if somebody suggests using pol...

4 days ago | 0

I don't know if matlab is calculating this properly
MATLAB is calculating what it calculated properly. The issue is, you told it to calculate the wrong thing. Computers are sooooo ...

4 days ago | 3

Linear interpolation in loop
I totally agree with Bob. (By the way, this is not linear interpolation. Interpolation passes exactly through ALL points.) You ...

5 days ago | 1

| accepted

Plotting a 2D crystal lattice from two primitive lattice vectors
First, you need to understand that MATLAB does not understand what you intend by this notation: v1= -0.5i + -sqrt(3)/2j Both i...

7 days ago | 0

Can someone help me
Why do you assume an analytical Laplace transform exists? There are many functions for which this is not true. Even then, there ...

7 days ago | 2

Help on trigonometric operations using syms variable.
You probably need to use rewrite. syms t4 S = sind(t4-90) S = sin((pi*(t4 - 90))/180) rewrite(expand(S),'sincos') ans ...

8 days ago | 2

| accepted

How to improve the accuracy of lu decomposition?
Sorry, but it is often the case that people are sloppy in their work. That is my expectation here. You gave us A and x_sol, but...

9 days ago | 0

how can I perform curve fitting for 3 degree exponential equation?
Fit will do it, sort of. You will need to pose an explicit model for the three terms. But please consider if you really can do ...

10 days ago | 0

| accepted

which way to call function is better?
Neither way is "better". Both feel just a little clumsy, since I'm not sure why you feel the need to package the variables toget...

10 days ago | 2

| accepted

secant method trouble shooting
When you have a problem like this, plot the function. In fact, plot the function anyway! Next, it is a bad idea to use variable...

11 days ago | 0

| accepted

Rolling Beta For Multiple x and y variables simultaneously
Is the x vector equally spaced? If so, then my movingslope code (found on the File Exchange) will do it trivially and efficientl...

11 days ago | 1

How do I plot an equation with an imaginary quantity?
Look at what you have. t=[0:0.01:10]; y=exp(-5*i*t); y(1:5) ans = 1 + 0i 0.99875 - 0.049979i ...

12 days ago | 0

Generate random Bistochastic matrix with zero diagonals
Hmm. I notice that the re-normalization trick offered by dpb sometimes seems to not converge well. That begs the question of wh...

12 days ago | 0

matalb convolution with memory
This is not a job for convolution, since h lies on both sides of the equality, with a lag on h. Use filter instead. You should...

13 days ago | 0

Compare and modify random vector with evenly spaced vector
Again, learn to use the tools in MATLAB. The first was linspace. A second is discretize. A=[0.1, 0.21, 0.346, 0.59, 0.744, 1]; ...

14 days ago | 2

| accepted

re-looping after terminating

15 days ago | 0

Solve not finding trivial zero
As always, you absolutely need to tell what release you are using, because this works with no problem. Done using R2019a: syms ...

16 days ago | 0

| accepted

Matrix subtraction within Matlab
whos Name Size Bytes Class Attributes E 2x1 16 double ...

17 days ago | 3

Curve fitting WITHOUT toolbox and removing outliers from data.
There is no standard method. Why not? because outliers are different things from what you have normally, and vary for each probl...

18 days ago | 0

natural cubic spline interpolation
Learn to use the debugger. This is a basic problem. You know what line the problem is on, but even if you did not, then you coul...

21 days ago | 0

Load more