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 Calculate R squared from a linear regress

They are hidden in the ‘stats’ output: [b,~,~,~,stats] = regress(y(:),[ones(size(x(:))),x(:)]); % get the intercept and slope ...

How Calculate R squared from a linear regress

They are hidden in the ‘stats’ output: [b,~,~,~,stats] = regress(y(:),[ones(size(x(:))),x(:)]); % get the intercept and slope ...

1 hour ago | 0

Answered

How to solve the Gompertz Equation

The reason the red line does not plot is that ‘b’ goes from about 3 to about 32, however ‘E’ is constant at about 451.7. So ‘E’...

How to solve the Gompertz Equation

The reason the red line does not plot is that ‘b’ goes from about 3 to about 32, however ‘E’ is constant at about 451.7. So ‘E’...

21 hours ago | 0

Answered

Why am I getting "Array indices must be positive or integers values"?

Rhe reason is that ‘up(t)’ was being interpreted as an indexing operation rather than a function call, and ‘t’ are not all posit...

Why am I getting "Array indices must be positive or integers values"?

Rhe reason is that ‘up(t)’ was being interpreted as an indexing operation rather than a function call, and ‘t’ are not all posit...

22 hours ago | 0

| accepted

Answered

plotting with for loop

To plot all of them on the same axes, put the figure call before the loop instead of inside it: figure hold on for i=1:lengt...

plotting with for loop

To plot all of them on the same axes, put the figure call before the loop instead of inside it: figure hold on for i=1:lengt...

1 day ago | 0

| accepted

Answered

system of ordinary differential equations

Note that it will be necessary to use ODE Event Location to stop and then re-start the integration at the discontinuities (, ) s...

system of ordinary differential equations

Note that it will be necessary to use ODE Event Location to stop and then re-start the integration at the discontinuities (, ) s...

1 day ago | 0

Answered

Plotting Intersection point on plot

Try this: Cpo = -0.75;a = 3.32; M = 0.2:0.01:0.8; Cp = Cpo./sqrt(1-M.^2); Cp_cr = 2./(a*M.^2) .* ((((2+(a-1)*M.^2)/(a+1))...

Plotting Intersection point on plot

Try this: Cpo = -0.75;a = 3.32; M = 0.2:0.01:0.8; Cp = Cpo./sqrt(1-M.^2); Cp_cr = 2./(a*M.^2) .* ((((2+(a-1)*M.^2)/(a+1))...

1 day ago | 1

| accepted

Answered

Getting an error for quiver 3

MATLAB uses U.S. English spelling conventions. See the Quiver Properties documentation section on Color .

Getting an error for quiver 3

MATLAB uses U.S. English spelling conventions. See the Quiver Properties documentation section on Color .

2 days ago | 1

| accepted

Answered

How to do Z transform with Z^-1 format?

The only option I can think of has nothing to do with the Symbolic Math Toolbox, and is instead the Variable argument in the Con...

How to do Z transform with Z^-1 format?

The only option I can think of has nothing to do with the Symbolic Math Toolbox, and is instead the Variable argument in the Con...

2 days ago | 1

| accepted

Answered

Find absolute, relative, and mean power of theta, beta and TBR (theta/beta ratio)

You can filter them using the approach in Need to break down EEG signals into 4 frequency bands. Once you have the filtered s...

Find absolute, relative, and mean power of theta, beta and TBR (theta/beta ratio)

You can filter them using the approach in Need to break down EEG signals into 4 frequency bands. Once you have the filtered s...

2 days ago | 0

Answered

Why are my staitistic functions returning an array rather than a single value?

The min, max, and mean functions operate on the first dimension that is greater than 1, so for a matrix, they will all produce a...

Why are my staitistic functions returning an array rather than a single value?

The min, max, and mean functions operate on the first dimension that is greater than 1, so for a matrix, they will all produce a...

2 days ago | 0

| accepted

Answered

Curve classification with interference/disturbance

One option is to evaluate the exponential curve at exactly the same values of the independent variable as the data (that I assum...

Curve classification with interference/disturbance

One option is to evaluate the exponential curve at exactly the same values of the independent variable as the data (that I assum...

2 days ago | 0

| accepted

Answered

Hello, I am having trouble plotting this graph. Whenever I run my code I get an error that I am not using the plot function correctly or I get a blank graph. I think it may have to do with how I solved my equation for T. Thanks for any help.

You are using the wrong plot function. Use fplot instead: fplot(Teq,[0 1]) xlabel('t') ylabel('Teq') EDIT — (27 Sep 20...

Hello, I am having trouble plotting this graph. Whenever I run my code I get an error that I am not using the plot function correctly or I get a blank graph. I think it may have to do with how I solved my equation for T. Thanks for any help.

You are using the wrong plot function. Use fplot instead: fplot(Teq,[0 1]) xlabel('t') ylabel('Teq') EDIT — (27 Sep 20...

2 days ago | 0

| accepted

Answered

Generate name of the given plot as output

I have absolutely no idea what you are asking. See if title or figure will do what you want.

Generate name of the given plot as output

I have absolutely no idea what you are asking. See if title or figure will do what you want.

2 days ago | 0

Answered

Need help to run this code

To use a function handle in a calculation, it is necessary to evaluate the function so it will be replaced by the numeric output...

Need help to run this code

To use a function handle in a calculation, it is necessary to evaluate the function so it will be replaced by the numeric output...

2 days ago | 0

Answered

Matlab code for fractions

Use the rat function: x = 1.5 [num,den] = rat(x) producing: num = 3 den = 2 .

Matlab code for fractions

Use the rat function: x = 1.5 [num,den] = rat(x) producing: num = 3 den = 2 .

2 days ago | 0

Answered

How to plot with 3 matrix

If you want the red and green lines to show, you need to plot them separately, and create handles for them to pass to the legend...

How to plot with 3 matrix

If you want the red and green lines to show, you need to plot them separately, and create handles for them to pass to the legend...

2 days ago | 1

Answered

Error using plot Not enough input arguments.

You may need to use the cell2mat function, or concatenate the elements inside a vector, using this (strange-looking but effectiv...

Error using plot Not enough input arguments.

You may need to use the cell2mat function, or concatenate the elements inside a vector, using this (strange-looking but effectiv...

2 days ago | 0

Answered

Getting FWHM from distribution fitter

One way to get the FWHM is to use the findpeaks function. It may be ‘overkill’ for only one peak, however it should give you th...

Getting FWHM from distribution fitter

One way to get the FWHM is to use the findpeaks function. It may be ‘overkill’ for only one peak, however it should give you th...

3 days ago | 0

| accepted

Answered

Trying to use findpeaks to isolate the portion of the signal that has a positive slope

This will identify and plot the positive slopes: T1 = readtable('73(4)_interval.xlsx'); Slope = gradient(T1{:,1}) ./ gradient...

Trying to use findpeaks to isolate the portion of the signal that has a positive slope

This will identify and plot the positive slopes: T1 = readtable('73(4)_interval.xlsx'); Slope = gradient(T1{:,1}) ./ gradient...

3 days ago | 0

| accepted

Answered

Using text, 2 variables, and decimals in fprintf

Try this: fprintf("The value you entered %.1f°C\nis equal to %.1f°F\n", temp, ans) so: temp = 10; ans = 50; fprintf("The ...

Using text, 2 variables, and decimals in fprintf

Try this: fprintf("The value you entered %.1f°C\nis equal to %.1f°F\n", temp, ans) so: temp = 10; ans = 50; fprintf("The ...

3 days ago | 0

| accepted

Answered

change timetable variable (working day to holiday)

Try this: dd = datetime(2016,01,01):days(1):datetime(2016,12,31); % Create ‘datetime’ Array workday = ones(si...

change timetable variable (working day to holiday)

Try this: dd = datetime(2016,01,01):days(1):datetime(2016,12,31); % Create ‘datetime’ Array workday = ones(si...

3 days ago | 0

| accepted

Answered

Multiple plots in a single X and y axis

Use the hold function. Example — x = linspace(1, 2, 250); y1 = sin(2*pi*x*5); y2 = cos(2*pi*x*7); figure plot(x, y1) ...

Multiple plots in a single X and y axis

Use the hold function. Example — x = linspace(1, 2, 250); y1 = sin(2*pi*x*5); y2 = cos(2*pi*x*7); figure plot(x, y1) ...

4 days ago | 0

| accepted

Answered

How to solve a system of 4 ODEs?

Try this: syms Sh(t) Ih(t) Sm(t) Im(t) Sh0 Ih0 Sm0 Im0 T Y betah = 1000; betam = 300; gammah = 0.004; gammam = 0.06; muh ...

How to solve a system of 4 ODEs?

Try this: syms Sh(t) Ih(t) Sm(t) Im(t) Sh0 Ih0 Sm0 Im0 T Y betah = 1000; betam = 300; gammah = 0.004; gammam = 0.06; muh ...

4 days ago | 0

Answered

Solve (a*B) + (c*D) = E without the Symbolic Toolbox

This would seem to be homework, and for homework we only give guidance and hints. I would set it up as an implicit equation (...

Solve (a*B) + (c*D) = E without the Symbolic Toolbox

This would seem to be homework, and for homework we only give guidance and hints. I would set it up as an implicit equation (...

4 days ago | 0

| accepted

Answered

how o count he number of occurences of a string in an external text file?

The function you want is probably fgetl (or related functions) rather than char. Then try: s = fgetl(fid); There are likel...

how o count he number of occurences of a string in an external text file?

The function you want is probably fgetl (or related functions) rather than char. Then try: s = fgetl(fid); There are likel...

4 days ago | 0

Answered

For Loop to calculate prob of pair of values occuring

Using the unique function with the 'rows' option may help. If you want to include a tolerance if the elements are °close enou...

For Loop to calculate prob of pair of values occuring

Using the unique function with the 'rows' option may help. If you want to include a tolerance if the elements are °close enou...

4 days ago | 0

Answered

Searching for a line of characters from a text file

It might be easier to use the fileread function to read the entire file in as text, then use strfind to locate the strings you w...

Searching for a line of characters from a text file

It might be easier to use the fileread function to read the entire file in as text, then use strfind to locate the strings you w...

4 days ago | 0

Answered

ERROR: Not enough input arguments.

That error could be thrown if ‘obsData’ is a variable that should be passed to your ‘CalcMKJointProb’ function as an argument, a...

ERROR: Not enough input arguments.

That error could be thrown if ‘obsData’ is a variable that should be passed to your ‘CalcMKJointProb’ function as an argument, a...

4 days ago | 1

| accepted

Answered

Need to make a 4D plot(3D + Colour)

The simplest option is likely the scatter3 function. plot it as: figure scatter3(x, y, z, [], t, 'filled') grid on axis e...

Need to make a 4D plot(3D + Colour)

The simplest option is likely the scatter3 function. plot it as: figure scatter3(x, y, z, [], t, 'filled') grid on axis e...

4 days ago | 0