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

I have a large vector, I would like to find a set of data which is a subset of the large vector.

ismember is exactly the tool to solve your problem. A = [1 3 5 7 9 8 6 4 2]; B = [5 6]; [LIA,LOCB] = ismember(A,B) LIA = ...

I have a large vector, I would like to find a set of data which is a subset of the large vector.

ismember is exactly the tool to solve your problem. A = [1 3 5 7 9 8 6 4 2]; B = [5 6]; [LIA,LOCB] = ismember(A,B) LIA = ...

etwa 13 Stunden ago | 1

Answered

Switch to write programs

You could write a switch statement for this. The problem is, since each case does a different thing, you effectively need 100 di...

Switch to write programs

You could write a switch statement for this. The problem is, since each case does a different thing, you effectively need 100 di...

etwa 20 Stunden ago | 1

Answered

Double vs Single Precision, Matlab in 2019

This topic is worth discussing. X = zeros(10,10, 'single'); The construction: X = single(zeros(10,10)); is four times slower!!...

Double vs Single Precision, Matlab in 2019

This topic is worth discussing. X = zeros(10,10, 'single'); The construction: X = single(zeros(10,10)); is four times slower!!...

ein Tag ago | 0

| accepted

Answered

how to decrease precision

You cannot tell MATLAB to use an arbitrary lower or higher precision. At most, you can work in single precision instead of doubl...

how to decrease precision

You cannot tell MATLAB to use an arbitrary lower or higher precision. At most, you can work in single precision instead of doubl...

2 Tage ago | 0

| accepted

Answered

pick numbers from matrix with probability

This is one of those question that are almost impossible to answer, because your goal is so fuzzy, too unclear to write code to ...

pick numbers from matrix with probability

This is one of those question that are almost impossible to answer, because your goal is so fuzzy, too unclear to write code to ...

2 Tage ago | 0

Answered

How do i plot 3 langrange polinomials in one figure?

Do you know how to plot ONE such polynomial? I hope so. If you do, then you need to use the hold command. That is, after you plo...

How do i plot 3 langrange polinomials in one figure?

Do you know how to plot ONE such polynomial? I hope so. If you do, then you need to use the hold command. That is, after you plo...

2 Tage ago | 0

Answered

Create binary vectors with specific hamming distance

Why does this seem pretty easy, if you just think about what Hamming distance means? https://en.wikipedia.org/wiki/Hamming_dist...

Create binary vectors with specific hamming distance

Why does this seem pretty easy, if you just think about what Hamming distance means? https://en.wikipedia.org/wiki/Hamming_dist...

2 Tage ago | 0

| accepted

Answered

How to Show 1/4 in 1/2^2?

Do you mean this? format rat 1./(1:10).^2 ans = 1 1/4 1/9 1/16 1/25 ...

How to Show 1/4 in 1/2^2?

Do you mean this? format rat 1./(1:10).^2 ans = 1 1/4 1/9 1/16 1/25 ...

4 Tage ago | 2

Answered

in the old old days, whos function also give total variable size, how do i do that now [ver 9.4.0.813654 (R2018a)]

Easy peasy. Even trivial. whos Name Size Bytes Class Attributes ans 1x1 8...

in the old old days, whos function also give total variable size, how do i do that now [ver 9.4.0.813654 (R2018a)]

Easy peasy. Even trivial. whos Name Size Bytes Class Attributes ans 1x1 8...

4 Tage ago | 0

Answered

It shows: Undefined function 'vpasolve' for input arguments of type 'double' when I run it. Can I know how to solve this?

Is f a symbolic variable? (No.) We see this: syms f f=zeros(rr); fn=1+2.*sqrt(f).*log(((rr)./3.7)+(2.51./(Re.*sqrt(f)))); f...

It shows: Undefined function 'vpasolve' for input arguments of type 'double' when I run it. Can I know how to solve this?

Is f a symbolic variable? (No.) We see this: syms f f=zeros(rr); fn=1+2.*sqrt(f).*log(((rr)./3.7)+(2.51./(Re.*sqrt(f)))); f...

4 Tage ago | 0

Answered

Exponential Fitting function not plotting the same information as the data points?

Where should I start? :-) A terribly important feature of ANY exponential model is you absolutely, positively need good start p...

Exponential Fitting function not plotting the same information as the data points?

Where should I start? :-) A terribly important feature of ANY exponential model is you absolutely, positively need good start p...

4 Tage ago | 0

| accepted

Answered

Averaging every element with nearby elements

A simple solution is to use conv2. It works quite well inside the domain. But then you will need to be careful around the edges....

Averaging every element with nearby elements

A simple solution is to use conv2. It works quite well inside the domain. But then you will need to be careful around the edges....

6 Tage ago | 1

| accepted

Answered

How to find the nearest pixel to the point attained by ginput() on the curve

Simple is to just extract the curve in terms of pixel coordinates. So you will have a list of points along the curve. Then use ...

How to find the nearest pixel to the point attained by ginput() on the curve

Simple is to just extract the curve in terms of pixel coordinates. So you will have a list of points along the curve. Then use ...

6 Tage ago | 0

Answered

surface interpolation based on x/y/diagonals data

By far the simplest solution is to use inpaint_nans. It will produce a surface, interpolating those empty areas. (However, you s...

surface interpolation based on x/y/diagonals data

By far the simplest solution is to use inpaint_nans. It will produce a surface, interpolating those empty areas. (However, you s...

7 Tage ago | 4

| accepted

Answered

Trying to find the mean and standard deviation without using the built in functions?

You show a function that does it already, although at a quick glance, it appears to compute the standard deviation incorrectly. ...

Trying to find the mean and standard deviation without using the built in functions?

You show a function that does it already, although at a quick glance, it appears to compute the standard deviation incorrectly. ...

7 Tage ago | 0

| accepted

Answered

Pearson correlation coefficient determination

What do you expect? It seems you keep on doing these computations, but then fail to think about the result, not thinking why you...

Pearson correlation coefficient determination

What do you expect? It seems you keep on doing these computations, but then fail to think about the result, not thinking why you...

8 Tage ago | 0

| accepted

Answered

Plotting implicit equation with fimplicit

Easy enough. Try this, for example. vpasolve(f(1,y)) ans = -80.224189505722446658042301607259 vpasolve(f(-20,y)) ans = 6...

Plotting implicit equation with fimplicit

Easy enough. Try this, for example. vpasolve(f(1,y)) ans = -80.224189505722446658042301607259 vpasolve(f(-20,y)) ans = 6...

8 Tage ago | 0

Answered

stream flow computed by using the Standardized Streamflow Index (SSFI).

Before you try to do something sophisticated using some tool, you need to learn to use that tool. Don't try to run before you kn...

stream flow computed by using the Standardized Streamflow Index (SSFI).

Before you try to do something sophisticated using some tool, you need to learn to use that tool. Don't try to run before you kn...

8 Tage ago | 0

Answered

Gram schmidth of polynomial

Of course orth is not designed to solve that problem, since it uses linear algebra. Nothing stops you from writing an orthognal...

Gram schmidth of polynomial

Of course orth is not designed to solve that problem, since it uses linear algebra. Nothing stops you from writing an orthognal...

8 Tage ago | 0

| accepted

Answered

problem with curve tracking obtained by the genetic algorithm

It is not really a mistake, except perhaps a mistake of choice. Or you might say a mistake of understanding the tools involved. ...

problem with curve tracking obtained by the genetic algorithm

It is not really a mistake, except perhaps a mistake of choice. Or you might say a mistake of understanding the tools involved. ...

8 Tage ago | 2

| accepted

Answered

Solve for two variables within to linear modulus equations

Pretty easy, really. You have a linear system of modular equations. mod(32*a+b,256)==165 mod(101*a+b,256)==76 Just subtra...

Solve for two variables within to linear modulus equations

Pretty easy, really. You have a linear system of modular equations. mod(32*a+b,256)==165 mod(101*a+b,256)==76 Just subtra...

8 Tage ago | 2

| accepted

Answered

I have a matrix, I want all values inside the matrix greater than 2*pi to be subtracted by 2*pi. All values less than 0 to have 2*pi be added to them. Other terms stay constant.

Theta4 = mod(Theta4,2*pi);

I have a matrix, I want all values inside the matrix greater than 2*pi to be subtracted by 2*pi. All values less than 0 to have 2*pi be added to them. Other terms stay constant.

Theta4 = mod(Theta4,2*pi);

8 Tage ago | 1

| accepted

Answered

Wrong results with "mod"

This fails because MATLAB cannot represent an integer larger than 2^53-1 as an exact integer, when working in double precision. ...

Wrong results with "mod"

This fails because MATLAB cannot represent an integer larger than 2^53-1 as an exact integer, when working in double precision. ...

8 Tage ago | 3

Answered

Double Integral unkown limits

Basic calc? I hope this is not homework. But at least you made some effort. You have formulated the problem as q = int( int( ...

Double Integral unkown limits

Basic calc? I hope this is not homework. But at least you made some effort. You have formulated the problem as q = int( int( ...

8 Tage ago | 1

| accepted

Answered

exact multiplication of variable in equation

But that IS the exact answer, the correct answer. Did you want MATLAB to produce the wrong answer? Maybe what you wanted is for...

exact multiplication of variable in equation

But that IS the exact answer, the correct answer. Did you want MATLAB to produce the wrong answer? Maybe what you wanted is for...

9 Tage ago | 1

| accepted

Answered

Finding the point of intersection of a single-loop line of best fit from my data?

I guess I don't see what is the problem. If the curve self-intersects, AND you have a list of points that define the curve, then...

Finding the point of intersection of a single-loop line of best fit from my data?

I guess I don't see what is the problem. If the curve self-intersects, AND you have a list of points that define the curve, then...

9 Tage ago | 1

Answered

Avoid infinity in the answer

Sorry. I had a typo in what I entered before. The first time through the loop. what do you expect? A is a scalar on the first ...

Avoid infinity in the answer

Sorry. I had a typo in what I entered before. The first time through the loop. what do you expect? A is a scalar on the first ...

9 Tage ago | 1

| accepted

Answered

estimate the parameters of lognormal distribution by the some values of CDF

Looks like this does reasonably well to me. fplot(@(x) logncdf(x,-.4,.75),[0,2]) hold on plot(x,y,'.')

estimate the parameters of lognormal distribution by the some values of CDF

Looks like this does reasonably well to me. fplot(@(x) logncdf(x,-.4,.75),[0,2]) hold on plot(x,y,'.')

10 Tage ago | 0

Answered

3D data cumsum does not work

Oh. So it does not work if you do this? qq = cumsum(rr,3); I guess you should report that as a bug, because it works for me. I...

3D data cumsum does not work

Oh. So it does not work if you do this? qq = cumsum(rr,3); I guess you should report that as a bug, because it works for me. I...

10 Tage ago | 1

| accepted

Answered

How to increase the precision of MATLAB R2015b

Short answer: You can't. Longer answer: Y o u c a n ' t d o t h a t. Well, not easily. ;-) Seriously, there is no floating ...

How to increase the precision of MATLAB R2015b

Short answer: You can't. Longer answer: Y o u c a n ' t d o t h a t. Well, not easily. ;-) Seriously, there is no floating ...

10 Tage ago | 0

| accepted