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

Answered

How to generate matrices that satisfies constraints on sum of row elements and sum of column elements?

You have 9 unknowns, with 6 linear equality constraints. The unknowns are bounded between 0 and 100. You don't say an upper boun...

How to generate matrices that satisfies constraints on sum of row elements and sum of column elements?

You have 9 unknowns, with 6 linear equality constraints. The unknowns are bounded between 0 and 100. You don't say an upper boun...

21 hours ago | 1

Answered

Matrix Equality Check Failed Using == and isequal

NEVER test for exact equality of floating point matrices. It won't happen, at least not unless you are very, very lucky. a_inv ...

Matrix Equality Check Failed Using == and isequal

NEVER test for exact equality of floating point matrices. It won't happen, at least not unless you are very, very lucky. a_inv ...

2 days ago | 0

| accepted

Answered

randperm non uniformly distributed

Sigh. This is NOT a question of non-uniformity. Just a question of not understanding how to recognize non-uniformity, and partia...

randperm non uniformly distributed

Sigh. This is NOT a question of non-uniformity. Just a question of not understanding how to recognize non-uniformity, and partia...

2 days ago | 1

| accepted

Answered

How to plot below multivalued function

But it is not a function, in some standard mathematical sense of the word. https://en.wikipedia.org/wiki/Function_(mathematics)...

How to plot below multivalued function

But it is not a function, in some standard mathematical sense of the word. https://en.wikipedia.org/wiki/Function_(mathematics)...

2 days ago | 0

Answered

How to do discontinuous piecewise linear model fitting?

SLM is not designed to solve the discontinuous linear case, nor would I ever decide to modify the code to allow that. (Sorry, bu...

How to do discontinuous piecewise linear model fitting?

SLM is not designed to solve the discontinuous linear case, nor would I ever decide to modify the code to allow that. (Sorry, bu...

2 days ago | 0

Answered

lagrangian polynomial function giving the incorrect answer

A good try at some code, with three errors in it. Well, essentially two errors, but you made one of those errors twice so I'm no...

lagrangian polynomial function giving the incorrect answer

A good try at some code, with three errors in it. Well, essentially two errors, but you made one of those errors twice so I'm no...

3 days ago | 2

| accepted

Answered

Vector integration; is this the most correct and/or accurate calculation?

This is a slightly complex question. Is it the correct use of trapz? Of course. Is it the most accurate possible way to integr...

Vector integration; is this the most correct and/or accurate calculation?

This is a slightly complex question. Is it the correct use of trapz? Of course. Is it the most accurate possible way to integr...

4 days ago | 0

| accepted

Answered

how to pick up all combination of numbers from multiple vectors

Don't store your vectors separately. Instead, learn to use tools like cell arrays, which make things hugely more efficient. V =...

how to pick up all combination of numbers from multiple vectors

Don't store your vectors separately. Instead, learn to use tools like cell arrays, which make things hugely more efficient. V =...

4 days ago | 2

| accepted

Answered

How can I solve the non linear algebraic equation system with a parameter

You CANNOT use fsolve with a symbolic parameter in the problem. CANNOT. Fsolve is a numerical tool. It finds a root (if it can t...

How can I solve the non linear algebraic equation system with a parameter

You CANNOT use fsolve with a symbolic parameter in the problem. CANNOT. Fsolve is a numerical tool. It finds a root (if it can t...

4 days ago | 0

Answered

How can I solve a sparse linear system efficiently in MATLAB?

B changes in each iteration. It is different. We are given no clue as to how it changes, or how much. We don't even know anythin...

How can I solve a sparse linear system efficiently in MATLAB?

B changes in each iteration. It is different. We are given no clue as to how it changes, or how much. We don't even know anythin...

5 days ago | 0

Answered

Finding cube with most Values

Why would you expect there exists built-in code to do something totally unusual like this? Built-in code is written to solve com...

Finding cube with most Values

Why would you expect there exists built-in code to do something totally unusual like this? Built-in code is written to solve com...

5 days ago | 0

Answered

Fitting Gamma to a curve with two peaks

This is a mistake that many people make. They know how to fit a model to a curve. But the model they know how to use does not ...

Fitting Gamma to a curve with two peaks

This is a mistake that many people make. They know how to fit a model to a curve. But the model they know how to use does not ...

6 days ago | 0

Answered

Determining values in array (of 1s and 0s) that neighbour similar values

As an alternative to a tool like imerode, you can just use conv2. The minor virtue is that conv2 lives in MATLAB proper, with no...

Determining values in array (of 1s and 0s) that neighbour similar values

As an alternative to a tool like imerode, you can just use conv2. The minor virtue is that conv2 lives in MATLAB proper, with no...

6 days ago | 0

| accepted

Answered

How to calculate of average numbers every n rows?

Pretty easy. What you need to learn is how MATLAB stores numbers in an array, how to reshape things so that you get what you wan...

How to calculate of average numbers every n rows?

Pretty easy. What you need to learn is how MATLAB stores numbers in an array, how to reshape things so that you get what you wan...

6 days ago | 1

| accepted

Answered

Deleted surf script on system

Sorry, but we cannot send you a copy of code. However, you can just download a new copy of MATLAB. Go to the support page. htt...

Deleted surf script on system

Sorry, but we cannot send you a copy of code. However, you can just download a new copy of MATLAB. Go to the support page. htt...

6 days ago | 0

Answered

hook for an optimization problem.

That is a bad idea. You want to adjust your objective function in an optimization, based on iteration count, or some other info...

hook for an optimization problem.

That is a bad idea. You want to adjust your objective function in an optimization, based on iteration count, or some other info...

7 days ago | 0

| accepted

Answered

Fibonacci sequence up to first 256 elements

While this is surely homework, you got it almost correct, with a few major errors. Preallocate the vector!!!!!!!!!!!!!! Never ...

Fibonacci sequence up to first 256 elements

While this is surely homework, you got it almost correct, with a few major errors. Preallocate the vector!!!!!!!!!!!!!! Never ...

7 days ago | 0

| accepted

Answered

How to work rdivide function

Please don't post answers to questions as you did to another question when you just want to ask a question. Regardless, it look...

How to work rdivide function

Please don't post answers to questions as you did to another question when you just want to ask a question. Regardless, it look...

10 days ago | 2

| accepted

Answered

How to perform piece-wise linear regression to determine break point?

The simple way? Use a tool that can solve the problem. Don't write code to do work when you don't understand the fundamentals be...

How to perform piece-wise linear regression to determine break point?

The simple way? Use a tool that can solve the problem. Don't write code to do work when you don't understand the fundamentals be...

10 days ago | 0

Answered

Finding standard errors in curve fitting tool

In real research, maybe YOU always show it that way. That is not true for everybody. Standard for you is not necessarily standar...

Finding standard errors in curve fitting tool

In real research, maybe YOU always show it that way. That is not true for everybody. Standard for you is not necessarily standar...

10 days ago | 0

Answered

How to do exponential curve fitting in the form of y=a*exp(-b*x)+ a constant

Sigh. You give us x as: x = 1:119; Then a vector y, of length 132. Since x was so simply created, I'll assume it is just 1:32...

How to do exponential curve fitting in the form of y=a*exp(-b*x)+ a constant

Sigh. You give us x as: x = 1:119; Then a vector y, of length 132. Since x was so simply created, I'll assume it is just 1:32...

10 days ago | 0

Answered

problem with fsolve optimization error message

You seem to misunderstand how things work. You have provided ONE unknown to solve for. However, there are TWO equations that ...

problem with fsolve optimization error message

You seem to misunderstand how things work. You have provided ONE unknown to solve for. However, there are TWO equations that ...

10 days ago | 0

Answered

Find combinations of two variables in functions which must equal certain value

Algebra? If we have q = 9 = sqrt(z1*z2) then it is trivial. z1*z2 = 9^2 So the curve is given as z2 = 81/z1 Plott...

Find combinations of two variables in functions which must equal certain value

Algebra? If we have q = 9 = sqrt(z1*z2) then it is trivial. z1*z2 = 9^2 So the curve is given as z2 = 81/z1 Plott...

12 days ago | 0

| accepted

Answered

Solving for a matrix

You have what? 2 unknowns? I've seen various versions of these equations that you have written. But you do not have 16 unknowns....

Solving for a matrix

You have what? 2 unknowns? I've seen various versions of these equations that you have written. But you do not have 16 unknowns....

13 days ago | 0

Answered

fminsearch: improving optimization of parameters over wide scale of y values

This is not a question of the optimizer you use. It is a question of scale, and your objective function. ANY optimizer will fail...

fminsearch: improving optimization of parameters over wide scale of y values

This is not a question of the optimizer you use. It is a question of scale, and your objective function. ANY optimizer will fail...

13 days ago | 1

| accepted

Answered

Solve with absolute value

Once you introduce that absolute value into the problem, you make it sufficiently nonlinear that no analytical solution can exis...

Solve with absolute value

Once you introduce that absolute value into the problem, you make it sufficiently nonlinear that no analytical solution can exis...

13 days ago | 1

| accepted

Answered

Extrapolation of irregular sampled data

Um, lets be serious. You want to extrapolate that mess? plot(DTN,WRL,'o') grid on Seriously? Exactly what would you draw fo...

Extrapolation of irregular sampled data

Um, lets be serious. You want to extrapolate that mess? plot(DTN,WRL,'o') grid on Seriously? Exactly what would you draw fo...

14 days ago | 1

Answered

Generate random numbers from a mixture distribution

Read David's answer. But let me explain it like this, because I think many people do not understand what a mixture distribution ...

Generate random numbers from a mixture distribution

Read David's answer. But let me explain it like this, because I think many people do not understand what a mixture distribution ...

14 days ago | 2

| accepted

Answered

Numerical Method to solve single function with multiple variables

What you do not understand is why it fails, and why a numerical method there has to fail. The simplest way to understand this is...

Numerical Method to solve single function with multiple variables

What you do not understand is why it fails, and why a numerical method there has to fail. The simplest way to understand this is...

16 days ago | 0