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

Parameter Estimation for a System of Differential Equations

Using this version of ‘kinetics’ (that also estimates the initial conditions for ‘DifEq’), function C=kinetics(k,t) c0=k(5:8)...

Parameter Estimation for a System of Differential Equations

Using this version of ‘kinetics’ (that also estimates the initial conditions for ‘DifEq’), function C=kinetics(k,t) c0=k(5:8)...

1 hour ago | 0

Answered

Convert Data from array

I am not certain what your data are, or what you want to do. One option for reducing the size of the array and still getting ...

Convert Data from array

I am not certain what your data are, or what you want to do. One option for reducing the size of the array and still getting ...

3 hours ago | 0

Answered

Can't get simple for loop to run

You may be encountering ‘floating-point approximation errror’. See Floating-Point Numbers for a description of them and how the...

Can't get simple for loop to run

You may be encountering ‘floating-point approximation errror’. See Floating-Point Numbers for a description of them and how the...

3 hours ago | 0

Answered

How to find out lag between two signals ?

One option is the finddelay function. There are related functions linked to in and at the end of that documentation page.

How to find out lag between two signals ?

One option is the finddelay function. There are related functions linked to in and at the end of that documentation page.

4 hours ago | 0

Answered

Index in position 2 is invalid. Array indices must be positive integers or logical values.

My guess is that the problem is using ‘Y(iter)’ and ‘K(ik)’ as indices in that assignment. They may not be integers greater tha...

Index in position 2 is invalid. Array indices must be positive integers or logical values.

My guess is that the problem is using ‘Y(iter)’ and ‘K(ik)’ as indices in that assignment. They may not be integers greater tha...

14 hours ago | 1

Answered

Accessing values in a Cell Array using Index Values stored in another array

That requires a bit of cell array gymnastics: NewVector = [1.5 1.5 2.1 2.2 2.2 2.2 2.2 0.9 0.8 2.4 2.3 2.8 2.4 2.9 3.1]; New...

Accessing values in a Cell Array using Index Values stored in another array

That requires a bit of cell array gymnastics: NewVector = [1.5 1.5 2.1 2.2 2.2 2.2 2.2 0.9 0.8 2.4 2.3 2.8 2.4 2.9 3.1]; New...

14 hours ago | 0

Answered

How to reshape an array horizontally

Using the reshape function: text1 = ['words'; 'words'; 'words'] text2 = reshape(text1', 1, []) producing: text1 = 3×5...

How to reshape an array horizontally

Using the reshape function: text1 = ['words'; 'words'; 'words'] text2 = reshape(text1', 1, []) producing: text1 = 3×5...

14 hours ago | 2

| accepted

Answered

Unable to perform assignment because the left and right sides have a different number of elements.

Subscript the vectors in the loop that calculates the new values: for i=1:nIterations-1 S(i+1)= S(i)-dt.*(h.*S(i)+rho.*I(...

Unable to perform assignment because the left and right sides have a different number of elements.

Subscript the vectors in the loop that calculates the new values: for i=1:nIterations-1 S(i+1)= S(i)-dt.*(h.*S(i)+rho.*I(...

19 hours ago | 2

| accepted

Answered

How to plot a values inside a while loop .

The easiest way is to store the intermediate results, then plot them at the end: while t<176400 H=3600; fprintf('\t\...

How to plot a values inside a while loop .

The easiest way is to store the intermediate results, then plot them at the end: while t<176400 H=3600; fprintf('\t\...

19 hours ago | 0

Answered

taking samples from a vector

Try these: D = load('psi.mat'); psi = D.psi; % (10962 x 1) Every5 = psi(1:5:end); ...

taking samples from a vector

Try these: D = load('psi.mat'); psi = D.psi; % (10962 x 1) Every5 = psi(1:5:end); ...

20 hours ago | 0

| accepted

Answered

String to Datenum Format using opts and Setvaropts

Try reading those in as strings, then doing the conversion later: t = repmat('20200721T145002Z', 5, 1); ...

String to Datenum Format using opts and Setvaropts

Try reading those in as strings, then doing the conversion later: t = repmat('20200721T145002Z', 5, 1); ...

20 hours ago | 0

Answered

specifying the horizontal linetype '_' produces an error.

Function arguments in MATLAB are positional, so it is necessary to provide values for the interventing arguments to use later ar...

specifying the horizontal linetype '_' produces an error.

Function arguments in MATLAB are positional, so it is necessary to provide values for the interventing arguments to use later ar...

21 hours ago | 0

Answered

Shade the region above the graph

Try this: % Maximum speed rho = 0.002378; % at sea level Vmax = 987.48; K = 0.0397887; rho30 = 0.00089; rhos = 0.374; % ...

Shade the region above the graph

Try this: % Maximum speed rho = 0.002378; % at sea level Vmax = 987.48; K = 0.0397887; rho30 = 0.00089; rhos = 0.374; % ...

22 hours ago | 0

Answered

How do I filter out unwanted frequencies from an audio file?

It would appear that the ‘mirror image’ refers to the complex double-sided Fourier transform. In addition to fft, you will li...

How do I filter out unwanted frequencies from an audio file?

It would appear that the ‘mirror image’ refers to the complex double-sided Fourier transform. In addition to fft, you will li...

23 hours ago | 0

| accepted

Answered

More than one frequencies

Multiply the two tones (modulate the 440 Hz with the 400 Hz) to get the ‘beat’ effect you want: sound(s, Fs) ...

More than one frequencies

Multiply the two tones (modulate the 440 Hz with the 400 Hz) to get the ‘beat’ effect you want: sound(s, Fs) ...

1 day ago | 0

| accepted

Answered

Butterworth filter without the 's' option

For analog filter designs (the ‘s’ option), use the freqs function. For discrete filter designs (without the ‘s’ option), use f...

Butterworth filter without the 's' option

For analog filter designs (the ‘s’ option), use the freqs function. For discrete filter designs (without the ‘s’ option), use f...

1 day ago | 0

Answered

How to graph a function with a parameter that changes with time.

It is straightforward to define and calculate the result of ‘y’ while varying both ‘t’ and ‘x’ at the same time, using matrix ar...

How to graph a function with a parameter that changes with time.

It is straightforward to define and calculate the result of ‘y’ while varying both ‘t’ and ‘x’ at the same time, using matrix ar...

2 days ago | 0

| accepted

Answered

How to scale an axis on a plot in powers of 10?

Set xlim to the limits you want. Example — x = logspace(5, 6, 25); % Create Data y = rand(size(x)...

How to scale an axis on a plot in powers of 10?

Set xlim to the limits you want. Example — x = logspace(5, 6, 25); % Create Data y = rand(size(x)...

2 days ago | 0

| accepted

Answered

ODE solvers - passing parameters

It is actually a bit more involved than simply passing parameters when you are using the function with any of the ODE solvers (o...

ODE solvers - passing parameters

It is actually a bit more involved than simply passing parameters when you are using the function with any of the ODE solvers (o...

2 days ago | 0

Answered

How can I to convert a cell to a double without losing the leading zeros?

Thank you for quoting my code from Extracting numbers from mixed string ! It is not possible to retain leading zeros in a num...

How can I to convert a cell to a double without losing the leading zeros?

Thank you for quoting my code from Extracting numbers from mixed string ! It is not possible to retain leading zeros in a num...

2 days ago | 0

Answered

Extracting numbers from mixed string

Another approach: str = 'preci_CZ_02000_20200101_0000.txt'; out = regexp(str, '(?:\d{4})\>','match'); producing: out = ...

Extracting numbers from mixed string

Another approach: str = 'preci_CZ_02000_20200101_0000.txt'; out = regexp(str, '(?:\d{4})\>','match'); producing: out = ...

3 days ago | 0

Answered

How can I plot two datasets together if they have different x axis values?

The ‘data.mat’ file contains data for only one day as datenum values, that apparently are all for 01-Jan-2020. One approach: ...

How can I plot two datasets together if they have different x axis values?

The ‘data.mat’ file contains data for only one day as datenum values, that apparently are all for 01-Jan-2020. One approach: ...

3 days ago | 0

| accepted

Answered

Highlight Specific Portion of Graph

I am not ccertain what you want to highlight, since that region is vanishingly small. Try this: %Emissive Power wl=10e-2:0...

Highlight Specific Portion of Graph

I am not ccertain what you want to highlight, since that region is vanishingly small. Try this: %Emissive Power wl=10e-2:0...

3 days ago | 0

| accepted

Answered

I want to sketch the parametric euqations lies on the cone, but the cone is so small and the lines are sparser than it should be.

Scale the size of the cone up by multiplying its variables with some appropriate constant (that I call a ‘Magnification Factor’ ...

I want to sketch the parametric euqations lies on the cone, but the cone is so small and the lines are sparser than it should be.

Scale the size of the cone up by multiplying its variables with some appropriate constant (that I call a ‘Magnification Factor’ ...

3 days ago | 0

| accepted

Answered

Getting a function I downloaded online to run

First, use dir on the folder to be certain it actually appears there. Second, see what: which('intpartition.m') returns. ...

Getting a function I downloaded online to run

First, use dir on the folder to be certain it actually appears there. Second, see what: which('intpartition.m') returns. ...

3 days ago | 0

Answered

How to apply bandpass filter to a single data type?

Yes. You can use single. See the documentation section for x . This specifically refers to the Signal Processing Toolbox b...

How to apply bandpass filter to a single data type?

Yes. You can use single. See the documentation section for x . This specifically refers to the Signal Processing Toolbox b...

3 days ago | 0

| accepted

Answered

glmfit not working: US's chances of recession

Use glmval to evaluate the result of the fit: T1 = readtable('USREC.xls'); ind = T1.ind; us2y10 = T1.us2y10; rec = T1.rec; ...

glmfit not working: US's chances of recession

Use glmval to evaluate the result of the fit: T1 = readtable('USREC.xls'); ind = T1.ind; us2y10 = T1.us2y10; rec = T1.rec; ...

4 days ago | 0

| accepted

Answered

How can I get peaks values and distance between them indicated in the figure?

The findpeaks function could possible do what you want.

How can I get peaks values and distance between them indicated in the figure?

The findpeaks function could possible do what you want.

4 days ago | 0

Answered

Why won't this plot?

The problem are the y-axis limits in the axis call. Comment-out the axis call (as I do here) and you will immediately see the...

Why won't this plot?

The problem are the y-axis limits in the axis call. Comment-out the axis call (as I do here) and you will immediately see the...

4 days ago | 0

| accepted