Community Profile

photo

John D'Errico


Retired

3,732 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

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

View details...

Contributions in
View by

Answered
Numerically integrate over function that gives out a matrix
While integral offers the option of integrating an array valued function, integral2 does not. However, nothing makes a loop a...

1 month ago | 0

| accepted

Answered
How can i find the first inersection point of tow functions?
You can't use the intersect function to find the intersection of two curves. Just because the name is similar does not mean it w...

1 month ago | 0

| accepted

Answered
Integrating bivariate normal distribution in polar coordinates efficiently
Why do you need to re-express the PDF in polar form? It is one line of code to convert polar form into cartesian form to do the ...

2 months ago | 0

Answered
How Do I Create/Fix My Code For Collatz Conjecture Using A For Or While Loop?
I'm not sure what assume(x>0) has to do with anything, because you are working with the variable n. But why have you not just...

2 months ago | 0

Answered
Power function fitting with my data
Since you have not posted your data, it is difficult to help you very much. But... You can use polyfit to fit the linear curv...

2 months ago | 0

| accepted

Answered
ToolBox for Zernike polynomial surface_Fitting
You can find tools for evaluation of Zernike polynomials on the file exchange, here: <https://www.mathworks.com/matlabcentral...

2 months ago | 0

Answered
Integrating a curve fitted with Sgolay
1. You are not fitting your data using sgolayfilt. All that does is try to reduce the noise in the data, assuming the underlying...

2 months ago | 0

Answered
How to create a symbolic expression with a string like '5.01e-7*x2 - 5.01e-7 + (-9*x1 + 4)/x1'?
str2sym( '5.01e-7*x2 - 5.01e-7 + (-9*x1 + 4)/x1') ans = 0.000000501*x2 - (9*x1 - 4)/x1 - 0.000000501

2 months ago | 0

| accepted

Answered
Matlab 2018a with parallel computing too slow
Parallel computing need not always gain. Why not? Because MATLAB already automatically does some multi-threading when it thinks ...

2 months ago | 0

Answered
Why is ScatteredInterpolant (linear) returning a value far outside of input data?
You are making a major error here in what you are trying to do. plot3(inX,inY,inZ,'bo') box on grid on Now, rotate...

2 months ago | 1

| accepted

Answered
How to obtain integer solutions only with fsolve?
Far too late to answer this, but worth explaining how to solve it. Intlinprog, has been suggested is not a viable solution, b...

2 months ago | 0

| accepted

Answered
Numerical evaluation of integral gives warning message
Ignoring the fact that you cannot just factor out -1 from that term in the integral, and get what you think you got, we have the...

2 months ago | 0

Answered
First-order optimality of system of non-linear equations is not converging to 0
A basic presumption of fsolve is that the objective equations to be solved are continuous and differentiable. Your equations ALL...

2 months ago | 0

Answered
Functions vs scripts: speed
Option B is a REALLY bad programming style. It is slow, as you found out. It prevents MATLAB from optimizing your code for effic...

2 months ago | 2

Answered
Hot to create a matrix with elements which moves to right as row increases
There are MANY ways to solve this. I'm not at all sure what the final dimension of the matrix is expected to be. Is it 100x100? ...

2 months ago | 2

| accepted

Answered
Function of the interpolation function
Um, you said interpolation, but you never said what kind of interpolation was used. The crystal ball is very foggy today, so I a...

2 months ago | 0

Answered
outputs of generated code are NAN
The crystal ball is so foggy today. Strange, because it is a nice, sunny day here. Sorry, but we cannot read your mind, nor c...

2 months ago | 0

Answered
Is it possible to partition a curve and fit it using different funtions
Yes. If you know what you are doing. But that means you need to learn about how to use piecewise functions. You need to learn ab...

2 months ago | 0

Answered
Hi.I have been trying a lot to "find" the answer. I still can not get it.
The error? Yours, in making an assumption about floating point arithmetic, and how numbers are stored. x1=(0:0.001:50 )'; ...

2 months ago | 0

Answered
Am I allowed to write functions that have names of matlab functions (copyright)?
I am not a lawyer. But I would argue that it is the code that matters, and the code that has a copyright, which will reside in t...

2 months ago | 0

Answered
What's the difference between gammainc & igamma? Which one should I use to compute incomplete upper gamma function? Which one is scaled??
igamma lives in the stats toolbox. It gives you an upper tail integral. gammainc lives in MATLAB proper. gammainc is scaled. ...

2 months ago | 2

| accepted

Answered
How to get a set of elements from a matrix given a set of index pairs?
If you want efficiency, assuming your real problem is much larger, then you need to learn how to use sub2ind. That means you nee...

2 months ago | 0

| accepted

Answered
How I generate random numbers with constraints?
This is NOT that hard to do. Yeah, I know it seems hard as hell. The first trick is to build a triangulation that describes t...

2 months ago | 0

Answered
I would like to offer a new algorithm to Matlab. Whom should I contact?
Contact nobody. Seriously, just because you have a neat new algorithm, the odds of The MathWorks wanting to add it to the la...

2 months ago | 3

| accepted

Answered
How to obtain the number of asymptotes from a function handle?
I will suggest what you are lacking is a basic understanding of modeling and statistics. Of the concepts of replication of a dat...

2 months ago | 1

Answered
Which one is faster: trace(a' * b) or sum(sum(a .* b', 2))?
Well, I could tell you, but then... Seriously, I cannot tell you, because this is something I cannot know. Nor can anyone els...

2 months ago | 1

Answered
Problem In curve fitting
You won't find a function that fits any arbitrary, essentially scattered set of data. And that is what you seem to have. Anyw...

2 months ago | 0

| accepted

Answered
Simple function constrainting a polyfit with lsqlin is giving strange fits
Is this homework? It seems more sophisticated than the classical homework assignment, so I will guess not. But, sorry, just thro...

2 months ago | 0

| accepted

Answered
3D interpolating polynomial
Now that you have shown the problem you are trying to solve... I'm pretty sure I remember telling you that you should not use...

2 months ago | 0

Answered
I have a 6x6 symbolic matrix A that I want to inverse. I am trying both inv(A) an d A\I to do the inversion. However, it takes forever (more than a day) until I stop it. My hardware is also very good. Core i7, 16 GN RAM.
People think their computers are huge. Super fast. They can do anything. So they get spoiled, expecting anything to work like th...

2 months ago | 1

Load more