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 likely is it that I can use simple linear regression to predict?

No real world data truly follows a perfectly linear model. Even where there is an essentially linear domain, there are always li...

How likely is it that I can use simple linear regression to predict?

No real world data truly follows a perfectly linear model. Even where there is an essentially linear domain, there are always li...

3 days ago | 0

Answered

Order of logical operators

You need to recognize how MATLAB evaluates a logical expression. Many people use that shorthand, to indicate two coupled compari...

Order of logical operators

You need to recognize how MATLAB evaluates a logical expression. Many people use that shorthand, to indicate two coupled compari...

4 days ago | 1

| accepted

Answered

is it possible that answers can be accepted?

Being an MVP does not give you the privilege to doubly accept an answer. Read the help for Answers. It tells you what privileges...

is it possible that answers can be accepted?

Being an MVP does not give you the privilege to doubly accept an answer. Read the help for Answers. It tells you what privileges...

4 days ago | 1

| accepted

Answered

Plotting the area defin

You know how to use meshgrid! In fact, I know that, because you used it in your other question. So it you want to plot someth...

Plotting the area defin

You know how to use meshgrid! In fact, I know that, because you used it in your other question. So it you want to plot someth...

4 days ago | 1

Answered

Start point power law fit

I'm not positive what tools you are using for the fit. I will assume the curve fitting toolbox. Almost all optimizers (nonlin...

Start point power law fit

I'm not positive what tools you are using for the fit. I will assume the curve fitting toolbox. Almost all optimizers (nonlin...

5 days ago | 0

Answered

Looking for some tips on a Simulation Project!

Is there a better way? Not really. In fact, your plan is actually a good one, and arguably the best approach. The true art will ...

Looking for some tips on a Simulation Project!

Is there a better way? Not really. In fact, your plan is actually a good one, and arguably the best approach. The true art will ...

5 days ago | 1

| accepted

Answered

assemble global stiffness matrix

K = zeros(10,10); k = [1 -1; -1 1]; for n = 1:9; rind = n + [0 1]; cind = rind; K(rind, cind) = K(rind, c...

assemble global stiffness matrix

K = zeros(10,10); k = [1 -1; -1 1]; for n = 1:9; rind = n + [0 1]; cind = rind; K(rind, cind) = K(rind, c...

5 days ago | 0

| accepted

Answered

Create a polar function from a polar regression

Your question is slightly ambiguous. Are you looking to find a model of the form z=f(r,theta)? Or do you want some model that li...

Create a polar function from a polar regression

Your question is slightly ambiguous. Are you looking to find a model of the form z=f(r,theta)? Or do you want some model that li...

5 days ago | 0

Answered

What are Contour Levels

A contour of the function z(x,y) is a set of points in the (x,y) plane, such that z(x,y) is fixed at some constant value. That c...

What are Contour Levels

A contour of the function z(x,y) is a set of points in the (x,y) plane, such that z(x,y) is fixed at some constant value. That c...

5 days ago | 0

Answered

Operands to the || and && operators must be convertible to logical scalar values

LEARN TO USE THE DEBUGGER!!!!!!!!! I did this: dbstop if error Next, I ran your code. Well, I tried to run it. f...

Operands to the || and && operators must be convertible to logical scalar values

LEARN TO USE THE DEBUGGER!!!!!!!!! I did this: dbstop if error Next, I ran your code. Well, I tried to run it. f...

6 days ago | 3

| accepted

Answered

Exponential fit using Linear Regression

Write down the model you want to use. DO IT! You can't solve this unless you understand & think about what you are doing. That r...

Exponential fit using Linear Regression

Write down the model you want to use. DO IT! You can't solve this unless you understand & think about what you are doing. That r...

6 days ago | 0

| accepted

Answered

How to calculate the ratio of two primes in a given set of primes?

As long as the set is sorted, you never need to worry about the ratio being greater than than 1. How do you compute a base 3 ...

How to calculate the ratio of two primes in a given set of primes?

As long as the set is sorted, you never need to worry about the ratio being greater than than 1. How do you compute a base 3 ...

8 days ago | 1

Answered

gamma function for N>100

No. You will not make it work for large values, when they exceed the limits of gamma itself. Your code is not better than what y...

gamma function for N>100

No. You will not make it work for large values, when they exceed the limits of gamma itself. Your code is not better than what y...

8 days ago | 1

Answered

find rows of Zeros in matrix

Time to learn MATLAB. How do you find that something is zero? A == 0 That returns 1 where an element of A is zero. EXACT...

find rows of Zeros in matrix

Time to learn MATLAB. How do you find that something is zero? A == 0 That returns 1 where an element of A is zero. EXACT...

9 days ago | 1

Answered

If statement with many logical or.

Your problem is EXACTLY in that you are trying to compare floating point numbers, for exact equality. This is something you shou...

If statement with many logical or.

Your problem is EXACTLY in that you are trying to compare floating point numbers, for exact equality. This is something you shou...

9 days ago | 2

Answered

Function not defined but it is in fact defined

Did you actually save it as an m-file? Is it saved to your search path? NOT saved in one of the MATLAB supplied directories? ...

Function not defined but it is in fact defined

Did you actually save it as an m-file? Is it saved to your search path? NOT saved in one of the MATLAB supplied directories? ...

9 days ago | 0

Answered

The following error is found: "Warning: Failure at t=7.068767e-01. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (1.776357e-15) at time t. > In ode45 (line 308)" Any suggestions as to a fix?

This is the classic signal of a stiff system. If you needed more than that, the numbers with widely varying orders of magnitude ...

The following error is found: "Warning: Failure at t=7.068767e-01. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (1.776357e-15) at time t. > In ode45 (line 308)" Any suggestions as to a fix?

This is the classic signal of a stiff system. If you needed more than that, the numbers with widely varying orders of magnitude ...

10 days ago | 0

Answered

Volume of irregular shape

Not sure I see the problem. You apparently have cross sections in say x and y, presumably, at various values for z. That means y...

Volume of irregular shape

Not sure I see the problem. You apparently have cross sections in say x and y, presumably, at various values for z. That means y...

10 days ago | 0

| accepted

Answered

How to make an exponential function taking as input a vector?

inp = 3; syms n n.^(0:inp-1) ans = [ 1, n, n^2]

How to make an exponential function taking as input a vector?

inp = 3; syms n n.^(0:inp-1) ans = [ 1, n, n^2]

11 days ago | 0

| accepted

Answered

How can I do least square problem to get certain area?

Compute the area of the polygon. I'll call it A. polyarea should suffice. Recognize that area scales with the square of the u...

How can I do least square problem to get certain area?

Compute the area of the polygon. I'll call it A. polyarea should suffice. Recognize that area scales with the square of the u...

11 days ago | 0

Answered

How to underline an undefined function or variable

I believe that capability would not exist, because it is easy enough to create a variable or function name on the fly. It would ...

How to underline an undefined function or variable

I believe that capability would not exist, because it is easy enough to create a variable or function name on the fly. It would ...

12 days ago | 2

| accepted

Answered

How to find point(s) of intersection between two scatter surfaces and the zero plane?

Hint: contour 1. That is, use contour to identify the level surface at 0 for each surface. The result will be a set of piecew...

How to find point(s) of intersection between two scatter surfaces and the zero plane?

Hint: contour 1. That is, use contour to identify the level surface at 0 for each surface. The result will be a set of piecew...

13 days ago | 0

| accepted

Answered

How can I plot a line of one data point (x,y) using linear interpolation

Linear interpolation is meaningless with one point. Said another way, there are infinitely many lines that pass through one poin...

How can I plot a line of one data point (x,y) using linear interpolation

Linear interpolation is meaningless with one point. Said another way, there are infinitely many lines that pass through one poin...

14 days ago | 0

| accepted

Answered

How can I fit the data if I know the relationship of x and y, but don't have expression form of y=.....

Use polyfit. Seriously. Your model is a linear one in those parameters. Here is your model: ((x+5.637)^(y-2))/1000 = a + b*...

How can I fit the data if I know the relationship of x and y, but don't have expression form of y=.....

Use polyfit. Seriously. Your model is a linear one in those parameters. Here is your model: ((x+5.637)^(y-2))/1000 = a + b*...

14 days ago | 0

| accepted

Answered

What is the simplest way to extract lengths of NaN sequences from a vector?

Given sequences in a vector of NaNs, you find the location of the start, then find the end. the length is given by the differenc...

What is the simplest way to extract lengths of NaN sequences from a vector?

Given sequences in a vector of NaNs, you find the location of the start, then find the end. the length is given by the differenc...

15 days ago | 1

| accepted

Answered

Conversion of 100 jpg images to PGM

Use a loop? Surely you can get the directory contents, so the names of all images in a directory, using a tool like dir. Now jus...

Conversion of 100 jpg images to PGM

Use a loop? Surely you can get the directory contents, so the names of all images in a directory, using a tool like dir. Now jus...

16 days ago | 0

Answered

How to divide anonymous functions

But what does this do? @(x) f(x)./df(x)

How to divide anonymous functions

But what does this do? @(x) f(x)./df(x)

16 days ago | 0

| accepted

Answered

Taylor Series for sine function

(Note: you might decide to read how I coded trig functions in my HPF toolbox. But that would be wild overkill for basic homework...

Taylor Series for sine function

(Note: you might decide to read how I coded trig functions in my HPF toolbox. But that would be wild overkill for basic homework...

16 days ago | 0

| accepted

Answered

how to solve this equation (vdmoins/2)*(1-cos((x + alpha)*(2 * pi)/360)) + (vpiston/2)*(1+cos((x)*(2 * pi)/360))==291

First, check that a root exists. vdmoins = 537; alpha = 45; vpiston = 426; fun = @(x) (vdmoins/2)*(1-cos((x + alph...

how to solve this equation (vdmoins/2)*(1-cos((x + alpha)*(2 * pi)/360)) + (vpiston/2)*(1+cos((x)*(2 * pi)/360))==291

First, check that a root exists. vdmoins = 537; alpha = 45; vpiston = 426; fun = @(x) (vdmoins/2)*(1-cos((x + alph...

16 days ago | 0

Answered

How to create symbolic polynomials from a coefficient vector and symbolic vector?

As Walter shows, you can do it using provided tools easily enough. Just to understand how things work, you can also do it direct...

How to create symbolic polynomials from a coefficient vector and symbolic vector?

As Walter shows, you can do it using provided tools easily enough. Just to understand how things work, you can also do it direct...

17 days ago | 0

| accepted