12,427 total contributions since 2012

Hic sunt dracones!

PROFESSIONAL: Physician (M.D.): Diplomate of the American Board of Internal Medicine; M.Sc. Biomedical Engineering: Instrumentation, Signal Processing, Control, System Identification, Parameter Estimation

NON-PROFESSIONAL: Amateur Extra Class Amateur Radio Operator; Private Pilot, Airplane Single Engine Land, Instrument Rating Airplane; Gamer

NOTE: I do not respond to emails or personal messages, unless they are about my File Exchange contributions.

Answered

How can I interpolate data with the function ScatteredInterpolant (or else) within the boundaries of the input data only?

Specify 'ExtrapolationMethod' as 'none'.

How can I interpolate data with the function ScatteredInterpolant (or else) within the boundaries of the input data only?

Specify 'ExtrapolationMethod' as 'none'.

1 hour ago | 0

Answered

Creating a vector out of variables

Use the format function to change the way they are displayed: A = 1/(10^(-6)); B = 22^(1/4); C = 4^(3+2); format long E ...

Creating a vector out of variables

Use the format function to change the way they are displayed: A = 1/(10^(-6)); B = 22^(1/4); C = 4^(3+2); format long E ...

2 hours ago | 0

| accepted

Answered

Remove NaN inside a loop cycle

Try this: B(i,:) = X(i,~isnan(X(i,:)));

Remove NaN inside a loop cycle

Try this: B(i,:) = X(i,~isnan(X(i,:)));

2 hours ago | 0

| accepted

Answered

ODE parameter optimisation to fit dataset

You need to pass ‘temp’ as an argument to ‘updateStates’., so you need to include that in the argument list: function f = upda...

ODE parameter optimisation to fit dataset

You need to pass ‘temp’ as an argument to ‘updateStates’., so you need to include that in the argument list: function f = upda...

7 hours ago | 0

Answered

How to upsample an RF signal by a non-integer factor.

The resample function allows ‘p’ and ‘q’ to be any integers, so even an irrational number for the sampling rate. x = randn(1,...

How to upsample an RF signal by a non-integer factor.

The resample function allows ‘p’ and ‘q’ to be any integers, so even an irrational number for the sampling rate. x = randn(1,...

8 hours ago | 0

Answered

ODE45 wont run, just says "error"?

You have two problems: First, your system has two differential equations, so you must have two initial conditions: ic = [0 1...

ODE45 wont run, just says "error"?

You have two problems: First, your system has two differential equations, so you must have two initial conditions: ic = [0 1...

18 hours ago | 0

| accepted

Answered

Plot for specific vibrational heat

Use element-wise operations: C_vv=((R*theta_v^2*(exp(theta_v./T)))./(((exp(theta_v./T))-1).^2.*T.^2)); ...

Plot for specific vibrational heat

Use element-wise operations: C_vv=((R*theta_v^2*(exp(theta_v./T)))./(((exp(theta_v./T))-1).^2.*T.^2)); ...

18 hours ago | 0

| accepted

Answered

Optimisation of a filter knowing input and output

The System identification Toolbox is dedicated to problems like this. See if the Signal Processing Toolbox invfreqz function ...

Optimisation of a filter knowing input and output

The System identification Toolbox is dedicated to problems like this. See if the Signal Processing Toolbox invfreqz function ...

23 hours ago | 0

Answered

Why will these plots not plot on the same graph?

Each plot erases the plot before it. To overcome that, use the hold function: subplot(4,4,i) plot(spdnpwr(1:Astop,x)...

Why will these plots not plot on the same graph?

Each plot erases the plot before it. To overcome that, use the hold function: subplot(4,4,i) plot(spdnpwr(1:Astop,x)...

1 day ago | 0

Answered

Find two ways to create a 3 x 5 matrix with all values equal to 100 (Hint: use ones and zeros).

It is referring you to the ones function and the zeros function. Please look them up in the documentation.

Find two ways to create a 3 x 5 matrix with all values equal to 100 (Hint: use ones and zeros).

It is referring you to the ones function and the zeros function. Please look them up in the documentation.

1 day ago | 0

Answered

How can I separate the two fprintf

Add a ‘\n’ newline character to the end of each line: fprintf('A new location was found.Enter an ID for it:''NE051\n'); ...

How can I separate the two fprintf

Add a ‘\n’ newline character to the end of each line: fprintf('A new location was found.Enter an ID for it:''NE051\n'); ...

1 day ago | 0

| accepted

Answered

How can I add a matrix into another matrix

If you want to insert ‘B’ somewhere other than as the first or last row of ‘A’: A = rand(16,5); B = rand(1, 5); newA = zeros...

How can I add a matrix into another matrix

If you want to insert ‘B’ somewhere other than as the first or last row of ‘A’: A = rand(16,5); B = rand(1, 5); newA = zeros...

1 day ago | 0

Answered

My Matlab filterDesigner is exhibiting errors when typed on the command line

In your Command Window or a script, type: ver to verify that you have the Signal Processing Toolbox installed. If you do, ...

My Matlab filterDesigner is exhibiting errors when typed on the command line

In your Command Window or a script, type: ver to verify that you have the Signal Processing Toolbox installed. If you do, ...

1 day ago | 0

Answered

Velocity cumtrapz or gradient

The gradient function calculates the approximate numerical derivative of a vector, and the cumtrapz function calculates the appr...

Velocity cumtrapz or gradient

The gradient function calculates the approximate numerical derivative of a vector, and the cumtrapz function calculates the appr...

1 day ago | 1

| accepted

Answered

How to do a nonlinear fit using least squares

This is actually a linear problem, so a linear approximation will estimate the parameters correctly: R = 8.314462; ...

How to do a nonlinear fit using least squares

This is actually a linear problem, so a linear approximation will estimate the parameters correctly: R = 8.314462; ...

2 days ago | 1

| accepted

Answered

Finding matrix values associated with plot point

One approach: A = rand(10,2); A(4,:) = [75 0.995]; Lrow = ismembertol(A, [75 0.995], 0.01, 'ByRows',1) RowNr = find(Lrow)...

Finding matrix values associated with plot point

One approach: A = rand(10,2); A(4,:) = [75 0.995]; Lrow = ismembertol(A, [75 0.995], 0.01, 'ByRows',1) RowNr = find(Lrow)...

2 days ago | 0

Answered

Unable to save data or continue through loop

I can’t run your code. However, since you are not defining the character array ‘Filenamesave’ as a cell array earlier in your c...

Unable to save data or continue through loop

I can’t run your code. However, since you are not defining the character array ‘Filenamesave’ as a cell array earlier in your c...

2 days ago | 0

Answered

Calculate slope at specific time over many days using polyfit and for loop

You appear to be calculating them correctly, just not storing them correctly. For a linear fit, polyfit will produce a (1x2) ve...

Calculate slope at specific time over many days using polyfit and for loop

You appear to be calculating them correctly, just not storing them correctly. For a linear fit, polyfit will produce a (1x2) ve...

2 days ago | 0

| accepted

Answered

How can I create a legend on the interception of 2 lines on a plot with its coordinates?

I demonstrated how to do that in: How can I interpolate a point in a x,y graph given only one of these values and being the poin...

How can I create a legend on the interception of 2 lines on a plot with its coordinates?

I demonstrated how to do that in: How can I interpolate a point in a x,y graph given only one of these values and being the poin...

2 days ago | 0

Answered

unable to use Low pass filter on experimental data

When I substitute some vectors for the missing data, the posted code runs for me without error. The filter function should ta...

unable to use Low pass filter on experimental data

When I substitute some vectors for the missing data, the posted code runs for me without error. The filter function should ta...

2 days ago | 0

| accepted

Answered

Isolating a single pulse by removing noise

Try this: A = dlmread('F0000CH1.csv',",",0,3); Time = 1e9.*A(:,1); Voltage = A(:,2); figure plot(Time,Voltage,'LineWidth...

Isolating a single pulse by removing noise

Try this: A = dlmread('F0000CH1.csv',",",0,3); Time = 1e9.*A(:,1); Voltage = A(:,2); figure plot(Time,Voltage,'LineWidth...

3 days ago | 1

| accepted

Answered

How to change the time increment of a text file to make a new data set from an existing one?

Use interp1: A = [1.1 7 8 5 1.2 8 9 4 1.3 9 10 3 1.4 10 11 12 1.5 11 12 1]; NewCol1 = min(A(:,1)) :...

How to change the time increment of a text file to make a new data set from an existing one?

Use interp1: A = [1.1 7 8 5 1.2 8 9 4 1.3 9 10 3 1.4 10 11 12 1.5 11 12 1]; NewCol1 = min(A(:,1)) :...

3 days ago | 0

Answered

Grid of values spacing in logarithmic scale

I am not certain what you want. Try this: xv = logspace(-5, -1, 25); yv = linspace(0, 1, numel(xv)); figure semilogx(x...

Grid of values spacing in logarithmic scale

I am not certain what you want. Try this: xv = logspace(-5, -1, 25); yv = linspace(0, 1, numel(xv)); figure semilogx(x...

3 days ago | 0

| accepted

Answered

How do I solve the inverse kinematics of a nonlinear differential equation?

You can use the techniques in: Parameter Estimation for a System of Differential Equations. You can likely optimise with respec...

How do I solve the inverse kinematics of a nonlinear differential equation?

You can use the techniques in: Parameter Estimation for a System of Differential Equations. You can likely optimise with respec...

3 days ago | 0

Answered

I have a *.wav file. How do I change the bit rate(bits per sample) of it?

The only way I am aware of to change the bit rate is to read the audio file using audioread, then write it with audiowrite using...

I have a *.wav file. How do I change the bit rate(bits per sample) of it?

The only way I am aware of to change the bit rate is to read the audio file using audioread, then write it with audiowrite using...

4 days ago | 0

| accepted

Answered

How can I graph exponential functions?

First, do not use the exponentiation operator here: y1 = (2*exp(-2*t)-7*exp(-2*t)+0.6)/(4*exp^(-2*t)); ...

How can I graph exponential functions?

First, do not use the exponentiation operator here: y1 = (2*exp(-2*t)-7*exp(-2*t)+0.6)/(4*exp^(-2*t)); ...

4 days ago | 0

Answered

Plot 2D points in 3D space

Since your trajectory is defined by two vectors, if you want to plot it in 3D space, you need to provide another vector. The ea...

Plot 2D points in 3D space

Since your trajectory is defined by two vectors, if you want to plot it in 3D space, you need to provide another vector. The ea...

4 days ago | 0

Answered

How can I interpolate a point in a x,y graph given only one of these values and being the point on the line?

Try this: x = 1:10; y = rand(1,10); figure plot(x,y) hold on xl = xlim; plot(xl(:)*[1 1], [1;1]*[0.5 0.9], '--r') hol...

How can I interpolate a point in a x,y graph given only one of these values and being the point on the line?

Try this: x = 1:10; y = rand(1,10); figure plot(x,y) hold on xl = xlim; plot(xl(:)*[1 1], [1;1]*[0.5 0.9], '--r') hol...

4 days ago | 0

Answered

plotting data from data files and saving each plot through out each run of the loop

You are likely seeing only the plot of the last file read. It is likely best to do the fiie reading and plotting in separate ...

plotting data from data files and saving each plot through out each run of the loop

You are likely seeing only the plot of the last file read. It is likely best to do the fiie reading and plotting in separate ...

4 days ago | 0