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

Coupled rate ODEs with ode45

The concentrations change appropriately, however they don’t change much and the concentrations are vanishingly small. That’s th...

Coupled rate ODEs with ode45

The concentrations change appropriately, however they don’t change much and the concentrations are vanishingly small. That’s th...

environ 2 heures ago | 0

Answered

Figure line won't connect/display all data points

Isolated points only plot if specified as markers. Try this: D1 = load('midpoint.mat'); midpoint = D1.midpoint_overlap_seq...

Figure line won't connect/display all data points

Isolated points only plot if specified as markers. Try this: D1 = load('midpoint.mat'); midpoint = D1.midpoint_overlap_seq...

environ 3 heures ago | 0

| accepted

Answered

How to solve this equation?

Probably the easiest approach: syms h z2 Eqn = h^0.66+0.0805*h == 0.045; [h,prms,cndx] = solve(Eqn,h, 'ReturnConditions',1)...

How to solve this equation?

Probably the easiest approach: syms h z2 Eqn = h^0.66+0.0805*h == 0.045; [h,prms,cndx] = solve(Eqn,h, 'ReturnConditions',1)...

environ 5 heures ago | 0

Answered

ode45: use span of length 2

The tspan argument can be anything you want it to be (within limits). To have ode45 to evaluate and output at only those valu...

ode45: use span of length 2

The tspan argument can be anything you want it to be (within limits). To have ode45 to evaluate and output at only those valu...

environ 6 heures ago | 0

Answered

passing a vector to a function: 'Not enough input arguments'?

With a function in that format, it is necessary to pass a function handle to lsqnonlin (or any other function that takes a funct...

passing a vector to a function: 'Not enough input arguments'?

With a function in that format, it is necessary to pass a function handle to lsqnonlin (or any other function that takes a funct...

environ 6 heures ago | 0

Answered

How to plot only the real solutions of an implicit function ?

Nothing is being generated: R = 0.35; L = 0.25; H = 0.4; f1 = @(x,y) sqrt(L^2-(R*(cosd(x)-sind(x).*sind(y))-H).^2); figu...

How to plot only the real solutions of an implicit function ?

Nothing is being generated: R = 0.35; L = 0.25; H = 0.4; f1 = @(x,y) sqrt(L^2-(R*(cosd(x)-sind(x).*sind(y))-H).^2); figu...

1 jour ago | 1

Answered

Plot and calculate Damping ratio

The findpeaks or islocalmax functions can return the information to do the calculations.

Plot and calculate Damping ratio

The findpeaks or islocalmax functions can return the information to do the calculations.

1 jour ago | 1

Answered

Trouble taking the differential of a function

‘What am I missing here?’ Most likely, using the Symbolic Math Toolbox. Try this: syms E I L w_0 x func(x) = (((w_0*L)...

Trouble taking the differential of a function

‘What am I missing here?’ Most likely, using the Symbolic Math Toolbox. Try this: syms E I L w_0 x func(x) = (((w_0*L)...

1 jour ago | 0

Answered

Help with Errorbars on Bar Graph

Try this: AngleFlex90 = [95 99; 93.33 80; 95.67 99.33]; AngleError = [8.9 6.6; 7.6 5; 4 1.2].'; figure hBar = bar(Angle...

Help with Errorbars on Bar Graph

Try this: AngleFlex90 = [95 99; 93.33 80; 95.67 99.33]; AngleError = [8.9 6.6; 7.6 5; 4 1.2].'; figure hBar = bar(Angle...

2 jours ago | 0

| accepted

Answered

Gaussian Fit for x and y data

Try this: D1 = readmatrix('Test1.xls'); x = D1(:,1); y = D1(:,2); gausfcn = @(b,x) b(1).*exp(-(x-b(2)).^2/b(3)); [maxy,i...

Gaussian Fit for x and y data

Try this: D1 = readmatrix('Test1.xls'); x = D1(:,1); y = D1(:,2); gausfcn = @(b,x) b(1).*exp(-(x-b(2)).^2/b(3)); [maxy,i...

2 jours ago | 0

| accepted

Answered

Shade the region between the lines and xy axis

Try this: x=linspace(-2,8); y1=@(x)(8-2*x); y3= @(x)(5+2.5*x); y4=@(x)(0*x); y5=xline(0); y1_xint = fzero(@(x) y1(x), 1);...

Shade the region between the lines and xy axis

Try this: x=linspace(-2,8); y1=@(x)(8-2*x); y3= @(x)(5+2.5*x); y4=@(x)(0*x); y5=xline(0); y1_xint = fzero(@(x) y1(x), 1);...

2 jours ago | 0

| accepted

Answered

Find index of value in array

It is not obvious to me how the number of subjects and the repitition time interact, however it is unlikely that a loop is neces...

Find index of value in array

It is not obvious to me how the number of subjects and the repitition time interact, however it is unlikely that a loop is neces...

2 jours ago | 0

| accepted

Answered

what is the reason of an empty diagram?

It is likely necessary to index the variables appropriately. Try this: xdot10=-(1/m_c)*(k_ss*(x(:,9)-x(:,5)+r*x(:,7))+c_ss*...

what is the reason of an empty diagram?

It is likely necessary to index the variables appropriately. Try this: xdot10=-(1/m_c)*(k_ss*(x(:,9)-x(:,5)+r*x(:,7))+c_ss*...

2 jours ago | 0

| accepted

Answered

Need help solving a system of 2 second-order differential equations using ode45

I am not certain what you want. This assignment: thetaVec = deval(thetaVals,tVec,1); returns the value of ‘theta’ for the ...

Need help solving a system of 2 second-order differential equations using ode45

I am not certain what you want. This assignment: thetaVec = deval(thetaVals,tVec,1); returns the value of ‘theta’ for the ...

2 jours ago | 0

Answered

how to solve 2nd order coupled system of differential equations with heaviside function using ode45 solver?

Numerical ODE solvers do not do well across non-differentiable discontinuities. The heaviside function in MATLAB is differentia...

how to solve 2nd order coupled system of differential equations with heaviside function using ode45 solver?

Numerical ODE solvers do not do well across non-differentiable discontinuities. The heaviside function in MATLAB is differentia...

2 jours ago | 0

Answered

Convert Excel to Timetable

‘I attached the excel sheet as well ...’ Not yet. The readtimetable function may be appropriate if you have R2019a or la...

Convert Excel to Timetable

‘I attached the excel sheet as well ...’ Not yet. The readtimetable function may be appropriate if you have R2019a or la...

3 jours ago | 0

Answered

set the vector same length

The approach depends on what you want as the result: x = [2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016]; ...

set the vector same length

The approach depends on what you want as the result: x = [2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016]; ...

3 jours ago | 0

Answered

How to get the first value in a set of array that is bigger than the first few values?

Try this: y = [1 1 1 1 1 1.5 1.7 1.9 2 2.7]; x = [25:35]; TF = ischange(y,'variance'); Idx = find(TF,1,'first') Out = x(...

How to get the first value in a set of array that is bigger than the first few values?

Try this: y = [1 1 1 1 1 1.5 1.7 1.9 2 2.7]; x = [25:35]; TF = ischange(y,'variance'); Idx = find(TF,1,'first') Out = x(...

4 jours ago | 0

| accepted

Answered

Combining repetitive curves into one average curve

One option is to do something similar to the approach in How do I find and plot the average of action potentials from a trace? ...

Combining repetitive curves into one average curve

One option is to do something similar to the approach in How do I find and plot the average of action potentials from a trace? ...

4 jours ago | 1

| accepted

Answered

Help translating this expression to Matlab

My best guess: y = (exp(3*t) + t.^2.*sin(4*t)).*cos(3*t).^2; or as an anonymous function: y = @(t) (exp(3*t) + t.^2.*sin(4*...

Help translating this expression to Matlab

My best guess: y = (exp(3*t) + t.^2.*sin(4*t)).*cos(3*t).^2; or as an anonymous function: y = @(t) (exp(3*t) + t.^2.*sin(4*...

4 jours ago | 0

Answered

How to integrate with distribution function?

That looks like a version of the Lognormal Distribution. It would likely be best to code the ‘M’ result as a function of ‘H’, a...

How to integrate with distribution function?

That looks like a version of the Lognormal Distribution. It would likely be best to code the ‘M’ result as a function of ‘H’, a...

4 jours ago | 0

Answered

"Invalid interpolation method" after moving to MATLAB2020b

See method in the interp1 documentation (R2020b, however I doubt if it’s changed significantly since R2018b).

"Invalid interpolation method" after moving to MATLAB2020b

See method in the interp1 documentation (R2020b, however I doubt if it’s changed significantly since R2018b).

4 jours ago | 0

| accepted

Answered

timetable to wav file

I never did anything similar, so this is simply the approach I’d try first. Perhaps first timetable2table then table2array, t...

timetable to wav file

I never did anything similar, so this is simply the approach I’d try first. Perhaps first timetable2table then table2array, t...

5 jours ago | 0

| accepted

Answered

How do I find the start and stop indexes of non-zero segments of a matrix?

The ischange function could be helpful. A related Signal Processing Toolbox function is findchangepts.

How do I find the start and stop indexes of non-zero segments of a matrix?

The ischange function could be helpful. A related Signal Processing Toolbox function is findchangepts.

5 jours ago | 0

Answered

Converting magnitude (dB) and phase (deg) to complex value

Try this: complexVector = [10.^(mag_dB/20) .* exp(1j*deg2rad(phase_degrees))] or as an anonymous function: complexVector = ...

Converting magnitude (dB) and phase (deg) to complex value

Try this: complexVector = [10.^(mag_dB/20) .* exp(1j*deg2rad(phase_degrees))] or as an anonymous function: complexVector = ...

5 jours ago | 1

| accepted

Answered

Different Approach to solve ODE

I have no idea how the ‘Linear Damping Response’ section figures into this. However: syms t x(t) Y Dx = diff(x); ode =...

Different Approach to solve ODE

I have no idea how the ‘Linear Damping Response’ section figures into this. However: syms t x(t) Y Dx = diff(x); ode =...

5 jours ago | 0

| accepted

Answered

Attempting to plot a 3 x 3 grid of plots

Try something like this: time = linspace(0,2*pi); response = @(Kp,Kd) sin(time*Kp) .* cos(time*Kd); Kp = [2.4 180 250]; K...

Attempting to plot a 3 x 3 grid of plots

Try something like this: time = linspace(0,2*pi); response = @(Kp,Kd) sin(time*Kp) .* cos(time*Kd); Kp = [2.4 180 250]; K...

6 jours ago | 1

Answered

Plotting help with a simple problem

Subscript all of them. Try this: a=750000; %staring amount b=35000; %starting withdrawl y=0; %years while a>b ...

Plotting help with a simple problem

Subscript all of them. Try this: a=750000; %staring amount b=35000; %starting withdrawl y=0; %years while a>b ...

6 jours ago | 1

| accepted

Answered

Finding lowest value and the index from vector excluding zero and inf

Try this: x = [1 3 2;-1 inf 0.5]; [r,index] = min(x(x>0)) producing: r = 0.5 index = 5...

Finding lowest value and the index from vector excluding zero and inf

Try this: x = [1 3 2;-1 inf 0.5]; [r,index] = min(x(x>0)) producing: r = 0.5 index = 5...

6 jours ago | 0

| accepted

Answered

Way to visualise system of ODEs

Try your code with these changes: [V1,Sbs] = odeToVectorField(ODE1,ODE2); F1 = matlabFunction(V1,'vars',{'t','Y'}); ...

Way to visualise system of ODEs

Try your code with these changes: [V1,Sbs] = odeToVectorField(ODE1,ODE2); F1 = matlabFunction(V1,'vars',{'t','Y'}); ...

6 jours ago | 0

| accepted