Community Profile

# John D'Errico

### Retired

4 343 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

View details...

Contributions in
View by

solving nonlinear equation by fsolve
Using max inside an objective that will then be applied to fsolve is a bad idea. It creates a function that is at best non-diffe...

environ 17 heures ago | 0

Conditional statement with vectors
help discretize

1 jour ago | 0

Why my result is 0×1 empty double column vector
Um, LOOK AT WHAT YOU DID? eqn eqn = [ 0 == 5780664229092589/18446744073709551616, 0 == 5780664229092589/18446744073709551616,...

2 jours ago | 1

Getting a smooth curve instead of two linear functions
You have two lines that create what is NOT a function, in the sense that it is single valued. So, for any x, you get a y out. He...

2 jours ago | 0

Y=sqrt((A^2*X^2+B^2*X^2)/(C+D^2*X^2))
People still seem to be missing that the fit will NOT be unique. The model cannot be estimated uniquely as it has been posed. Fi...

3 jours ago | 2

How to solve extra long equations with multiple unknowns?
You have two fairly complicated equations, in two unknowns. Why do you expect an analytical solution to exist at all? I'd have b...

4 jours ago | 0

| accepted

How to explain a bad performance rating using the bench command?
Lots of reasons are possible. The ones that come to mind immediately are: Were you running something else at the same time? Bro...

4 jours ago | 0

How do I randomly generate numbers with a certain amount of probability?
As is often the case, I would suggest you are overthinking this. You have a sequence of 24 pairs of images to be shown. There ...

7 jours ago | 0

Randomly dividing an integer (non-uniform distribution)
The problem with the alternative answers given, is they tend to have a flaw, in that they do not sample the space of interest we...

7 jours ago | 2

How to plot a variable in MATLAB which can not be separated explicitly ?
Is ln meant to denote the NATURAL logarithm? If so, then you use log in MATLAB. At first, I thought you mean to write lin, whic...

8 jours ago | 0

| accepted

could anyone help me how to reshape the matrix.
You are not asking to do a reshape, which does not change the total number of elements. A = A(1,:);

9 jours ago | 0

| accepted

generating a sequence of numbers
Not if a1, a2, a3, a4, etc., are separate variables. If that is what you have done, then it is time to learn to program in ways ...

9 jours ago | 0

| accepted

extrapolate the plot to the point out of the interval
You can't. Well, you can, but interp1 will give you meaningless garbage, as it should. Extrapolation is a dangerous thing. And ...

10 jours ago | 1

why it can't be used as a number?
It can be used as a number, IF you understand what you are doing. MATLAB works in DOUBLE PRECISION. A double precision number w...

10 jours ago | 3

| accepted

An example of using crammers rule or geuss elimination?
Don't use either of them! There are many examples of things that you might learn to use when doing homework, and in class as a s...

10 jours ago | 0

Cannot use fzero function
My guess is you did not actually save that function as an m-file on your search path. This is why MATLAB could not find the func...

11 jours ago | 1

How to define nuclear norm in matlab?
What is difficult to program? A quick search online suggests it is the L-1 norm of either the vector of singular values, or of t...

11 jours ago | 0

| accepted

Why won't this program run?
Because you don't understand how to use the function zeros? Go back to go, do not collect \$200, and read the getting started tut...

11 jours ago | 1

It doesn't give a result. mablab couldn't take the integral of M = cos(2*pi*a*ti);
"It doesn't give a result. mablab couldn't take the integral of M = cos(2*pi*a*ti);" Actually, the failure arises because you d...

11 jours ago | 2

unbounded problem in linprog but not in fmincon
This is your problem? A=[ 1 1 1 0 0 0 0 0 0; -2.5 0 0 1 -1 0 0 0 0;0 -3 0 0 0 1 -1 0 0;0 0 -20 0 0 0 0 1 1;0 0 0 0 0 0 0 1 0]; ...

12 jours ago | 2

| accepted

Solve tridiagonal matrix system by thomas algorithm
Is it obligatory to create a matrix with those specific elements? Of course not. As long as you know what elements have which va...

12 jours ago | 0

| accepted

Heun's method
Is there a general code? No, unless you write it, or find it on the file exchange. Why should there be?

12 jours ago | 0

How to plot a nonlinear equation using FSOLVE in MATLAB
You have an implicit function. So a relationship involving two variables, where there is no way to resolve one as a function of ...

13 jours ago | 0

| accepted

Obtaining a fourth order of accuracy approximation formula for y''(0) and findind rhe unknown coefficients
Save this function as an m-file, NOT in the MATLAB directories, but on your search path. function ypp = accuracyapprox syms ...

14 jours ago | 0

Extrapolating intersection points (signal processing/curve fitting)

14 jours ago | 0

How to generate below matrix
Lets be serious here. You want to learn to create a general matrix, with elements in various places, that may, or may not, be wh...

14 jours ago | 0

| accepted

how can i show that this equation has at least one solution with the given itnerval
We should not be doing your homework. But since Star has already answered your question, let me see if I can give you an idea. ...

15 jours ago | 1

| accepted

fmincon with nonlinear equality constraints
This is barely an optimization problem at all. Many of your nonlinear constraints are just a kludge, a way to use a nonlinear e...

15 jours ago | 1

System implementation for loop
Don't create a list of 84 distinct numbered variables. This is a bad idea, terribly poor programming style. It willl create bugg...

15 jours ago | 0

| accepted