# John D'Errico

### Retired

A retired applied mathematician, consultant, sometime mechanical engineer, numerical analyst, woodworker, bridge player. Please DON'T contact me, as too many students then decide I am their personal consultant if I allow it. I won't do consulting by mail.

**Statistics**

RANK**10**

of 292,520

REPUTATION**21,443**

CONTRIBUTIONS

**15** Questions

**7,612** Answers

ANSWER ACCEPTANCE **
46.67%
**

VOTES RECEIVED**4,643**

RANK**4** of 19,904

REPUTATION**65,132**

AVERAGE RATING**4.80**

CONTRIBUTIONS**62** Files

DOWNLOADS **988**

ALL TIME DOWNLOADS**587125**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**1** Highlight

AVERAGE NO. OF LIKES**8**

**Feeds**

How to solve this problem combining sequences and reasoning using code?

I would probably think first, and only then write code. I gather the global sequence will always be 1:(4*m+2), so the first 4*m+...

21 hours ago | 0

Find closest value in array

To be honest, the easiest way is to use knnsearch. It works well in one dimension, as you have here, and it should be quite effi...

6 days ago | 1

Calculations with distributions of variables only

Um, yes. And, no. Firstly, very likely there will be no "named" distribution for even such a simple expression. And depending ...

7 days ago | 0

How to fastly calculate this matrix operation

First, use better variables. I is a terrible name to use , especially capital I, since it is so easily confused with the number ...

7 days ago | 0

| accepted

Find the turing pattern for following equation

I won't do your homework, since this is highly likely to be homework with no effort made on your part, just from the way you ask...

9 days ago | 0

| accepted

In Pskmod Code: Reshaping the output signal using the transpose operator .' , Introduce a sign change.

No. You have it wrong. Completely backwards, in fact. The .' operator does NOT cause a sign flip. That is called a conjugation. ...

9 days ago | 0

Why am I getting gaps in my data when I attempt to interpolate my curve?

As is always the case, look at what you did. Think about it. If necessary, think again. xy = readtable('Sample Test.txt') plot...

11 days ago | 2

How to call a own function in other mfile?

Did you save it on your search path? (Do you know what your search path is?) Spend some time reading the help for tools like add...

13 days ago | 0

Show Only certain variables in the workspace

The point of what @Stephen23 and I are trying to tell you is that you are asking the wrong question. You want someone to teach y...

14 days ago | 0

Solve a system of two variable inequalities with symbolic toolbox

fimplicit does not plot inequalities. Sorry. If you read the help, it never says anything about inequalities. Simplest is to ju...

15 days ago | 0

| accepted

How to fix "Error using indexing" while calculating differential equations?

The code you show will work perfectly in MATLAB, in literally any recent release of MATLAB. R2023 is entirely recent. However, ...

16 days ago | 0

Writing a code to determine the gradient change in a profile

Your problem lies in this line: change_p = (abs(data.variable.gradpressure(i,j+1))-abs(data.variable.gradpressure(i,j)))/abs(da...

18 days ago | 0

| accepted

Could MATLAB please provide rref() without the rational conversion?

Just look at the code. type rref Do you see the very last thing it does is do the conversion? Just write your own version that...

18 days ago | 0

| accepted

Why does eig return different eigen values depending on whether eigen vector outputs are specified ?

Gosh, the eigenvalue questions are coming fast today. You have an 11x11 matrix. The eigenvalues of that matrix are equivalent to...

18 days ago | 0

How to interprete an analytical eigendecomposition for a polynomial matrix with size nxn > 4x4 using the Symbolic Math Toolbox.

Ok, do you understand that you CANNOT compute the roots of a polynomial, if the degree of that polynomial is greater than 4? Wel...

19 days ago | 1

| accepted

Strict inequalities are not supported (learn why)

It is NOT related to the release number. Sorry. That has nothing to do with it. This has been the case since release 0 of MATLAB...

21 days ago | 0

Curve Fitter Polynomial Plots Strangely In Script

CONGRATULATIONS! You win an award for the one millionth person to make this mistake! Your award is a free trip to the fabled vac...

21 days ago | 0

Why is indexing a sparse matrix not behaving how I would expect?

This is not a question about sparse matrices. Well, it is, but it is not really. Sparse matrices are exactly the same as any oth...

21 days ago | 0

how to write the right code to measure the elapsed time of this method d1 = diag(1./diag(A))

Why do you care? The computations will be almost inifinitessimal, even for a huge matrix. (Do you understand the notation O(n)?)...

23 days ago | 1

Alternative to interp2

Perhaps you are calling interp2 multiple times in a loop, when a single call with multiple points will be far faster. This would...

24 days ago | 0

How can people who are bad at math and have no programming aptitude learn MATLAB? (Long question)

An old question, one that surely would be better placed in a discussion, now that we have them. However, as soon as someone dec...

27 days ago | 0

Someone that works with symbolic variables?

When k is even slightly large (apparently 4 is large enough) things go to hell. Did I not answer this question before? I know I ...

28 days ago | 1

using polyval with one of the polynomials of a spline obtained with the unmkpp command, the results do not overlap! Why?

@David Goodmanson and @dpb and @Steven Lord have all said the polynomial segments are intended to be LOCAL with respect to the b...

28 days ago | 0

Problems with code with symbolic variables.

No. I won't consult by gmail, or whatever. But there is no need. Even for k==2, what do I see? eqn = [3*c1^2 + 3*c3 == 0, 3*c...

28 days ago | 0

MATLAB Programming Techniques, Extracting Portions of a table

Why do you need it? Well, I don't see the question in the course, and I am not enrolled in the course, so... But what does that...

28 days ago | 0

I want show population on plot like 36M, 37M....

You want the plot to plot each point as a string like 36M, 38M, etc? Why not just divide by 1e6, then use the axis label to ind...

28 days ago | 0

| accepted

Why are the components of the two eigenvectors not continuous and smooth, when the underlying data is continuous and smooth?

You can think of the eigenvalues (and assiciated eigenvectors) as coming from the roots of a polynomial. In fact, they do exactl...

28 days ago | 2

How to interpolate values given a starting and end point

If you ONLY have two data points, the only possible interpolation is LINEAR. There is no fancy method to interpolate in a nonlin...

1 month ago | 0

Syntax for specifying boundary condition using dsolve.

Your beam is fixed in position at the left end, as is the slope at that point. At the right end, you have fixed the location, b...

1 month ago | 1

| accepted

How to use fminsearch for vectors

I think your problem is you are confused. And your confusion turns into a highly confusing question. Questions like is the optim...

1 month ago | 1