# John D'Errico

### Retired

DON'T contact me. I won't answer questions. PERIOD. I don't do your homework. I won't do consulting. A retired mathematician, numerical analyst, woodworker, bridge player.

**Statistics**

RANK**11**

of 258,291

REPUTATION**17,549**

CONTRIBUTIONS

**10** Questions

**6,142** Answers

ANSWER ACCEPTANCE **
50.0%
**

VOTES RECEIVED**3,782**

RANK**4** of 17,801

REPUTATION**61,727**

AVERAGE RATING**4.80**

CONTRIBUTIONS**57** Files

DOWNLOADS **1406**

ALL TIME DOWNLOADS**555887**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**1** Highlight

AVERAGE NO. OF LIKES**6**

**Content Feed**

Plot figure for f(y,z)=0

Simple enough. Define the two functions. Then subtract them, and plot using fimplicit. f = @(z) 0.07*z.^2./(0.09 + z.^2); g = ...

4 hours ago | 0

Formulate an objective function with summation terms to solve a linear programming problem

Why would you need fmincon on a purely linear problem? u and v may be different vectors in your eyes, but they can trivially b...

12 hours ago | 0

| accepted

Solve differential equation from Matlab

Making various assumptions, we see the solution as: syms ka kd C xmax syms x(t) dsolve(diff(x) == (ka*C*(xmax-x)-kd*x)/(1+ka*...

14 hours ago | 0

Obtaining the combinations of a vector array to satisfy lineal constrains.

Is it possible? Of course. Exhaustive enumeration. Just try all combinations, saving those that work. Is that easy? OF COURSE NO...

15 hours ago | 0

Random number generation with min, max and mean

Sigh. I've probably seen different variations of this question asked at least many hundreds of times over the 40+ years I have b...

3 days ago | 0

fit tool with errors in x and y

You can't. Period. You cannot use fit to solve a problem with errors in both x and y. That does not say the problam is never sol...

3 days ago | 0

roots(x) vs root= interp1(y,x,0)

You need to understand the mathematics. Lost you will be without that (to misquote someone named Yoda.) For this polynomial: s...

4 days ago | 0

How to create random matrix with specified step in interval [a, b]

You can also use indexing. The idea is to generate random indexes. ValidRandomSet = 5:3:34 m = 7; n = 6; ind = randi(numel(V...

5 days ago | 2

Interpolate using a different method without the original image

Um, no, or, yes. Anyway, you cannot do it directly. And it may be completely impossible to do. All of that depends on several th...

7 days ago | 0

How to find the volume of cross-sectional area of a cylinder

Is there a ready made function that will do the mathematics for you, based only on an inequality? No. You will need to do some m...

8 days ago | 0

| accepted

Error solving bvp4c - Singular jacobian

You have a simple classical ODE, with two INITIAL conditions, not boundary conditions at different ends. So use a tool like ODE4...

10 days ago | 0

noisy plot after calculating first derivative

You should recognize that differentiation is a noise amplification operator. So any small amounts of noise in your signal, even ...

10 days ago | 0

| accepted

fminsearch with side conditions

Generally, the solution is to not use fminsearch. Use a better optimizer instead. It will be faster, and you will get a better a...

10 days ago | 0

Obtaining value of highest order derivative over simulation period

Can you use schemes like ODE45, combined with gradient to compute exact estimates of the high order derivatives? Sadly, no. High...

11 days ago | 1

Acceleration at the center of the triangle

If you have some known parameter at the three corners of a triangle, then the best estimator of that parameter at the center of ...

12 days ago | 1

How to use bitn

You cannot define a scalar variable as a binary one with an arbitrary number of bits. You can define integer variables, with a s...

13 days ago | 0

Why I'm getting error (too many arguments) in my integral

You need to pay MUCH more attention to your code. For example, just a quick look shows this: Intdoble6=int(int(2*y^2,x,0,1)4*x...

13 days ago | 0

I nee to write a code to solve a definite integral. The output format has to be fprintf.

Do you understand that MATLAB REQUIRES a multiplication operator? You cannot just put a number next to a letter, and expect MATL...

14 days ago | 1

Maximum Likelihood Estimation function

Is there another way? Why not negate the function, and then use a tool like fminbnd? Or fminsearch. Or fmincon or fminunc, or .....

15 days ago | 0

What optimizer should I use?

This is not a problem of finding an optimizer. This is a problem of understanding how to formulate a problem so that it is possi...

16 days ago | 0

simulation stopped because of step size tolerance and constraints

Let me see. You posed an optimization problem. The solver returned a result, one that SATISFIES the tolerances you posed. You we...

16 days ago | 0

Revolving a curve about the y-axis to generate a 3D surface

Certainly. Just write the code yourself. Seriously, it is not difficult. Consider the function y = f(x). f = @(x) x.*(1-x); ...

16 days ago | 0

| accepted

matlab rank of a matrix

Because the call: R = ones(100,100); rank(R,1e-20) attempts to do something that is demonstrably silly, in terms of double pr...

16 days ago | 0

| accepted

which project of these projects will be easy with matlab?

I think you do not understand. ANY project can be either easy, or too difficult for you to handle. What matters is if you unders...

21 days ago | 0

How should I approach solving differential equation as function of two variables r, k?

While you COULD use an ODE solver, this is something you would ONLY do if the ODE had no analytical solution. And this ODE has a...

22 days ago | 1

Fmincon too many input arguments

How are you using it? That is, how did you call the function try_no_gradient(u0)? When you get an error message, show the COMPL...

22 days ago | 0

How to subtract only certain elements of a vector

a and b are not vectors in your question, they are arrays. However, if you want to do this, nothing stops you from selecting th...

22 days ago | 0

| accepted

Plot the graph using non linear equation

A nonlinear problem like this is called an implicit function. You can think of the value of h, as a function of theta, but there...

23 days ago | 1

convert current date and time to char

Easier than you think. First, what is the current time? format long g CurrentTime = now That might not seem terribly helpfu...

24 days ago | 1

Ｌｉｍｉｔ ａｎｇｌｅ ｉｎ ［－９０，９０］ ｄｅｇｒｅｅ

You cannot simply constrain an ODE solver to stay within bounds. However, almost certainly, if the ODE solver wants to go outsid...

26 days ago | 0