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 to create a Symbolic vector

Try this:: n = inputdlg('Enter the length of the vector (integer): '); n = str2double(n); syms x x = sym('x',[1 n]) pro...

How to create a Symbolic vector

Try this:: n = inputdlg('Enter the length of the vector (integer): '); n = str2double(n); syms x x = sym('x',[1 n]) pro...

ongeveer 2 uur ago | 0

Answered

1D interpolation by y = ax+b

To set the start point at the origin (0,0), calculate the slope as: slope = x(:) \ y(:); for example: x = 0:0.1:10; y = ra...

1D interpolation by y = ax+b

To set the start point at the origin (0,0), calculate the slope as: slope = x(:) \ y(:); for example: x = 0:0.1:10; y = ra...

ongeveer 2 uur ago | 0

Answered

A little question of [] and for loop

The full code should actually be: A = []; for i=1:50 A=[A i]; end It works by concatenating the value of ‘i’ to existi...

A little question of [] and for loop

The full code should actually be: A = []; for i=1:50 A=[A i]; end It works by concatenating the value of ‘i’ to existi...

ongeveer 3 uur ago | 1

Answered

Plot surface from non-anonymus function

See if this does what you want — function z = test(w) x = w{1}; y = w{2}; z = 2*x.^2 + 2*y.^2 +10*(1.1*y.^2 +...

Plot surface from non-anonymus function

See if this does what you want — function z = test(w) x = w{1}; y = w{2}; z = 2*x.^2 + 2*y.^2 +10*(1.1*y.^2 +...

ongeveer 15 uur ago | 0

| accepted

Answered

Find distance between one point and a subset of other points.

See if the pdist function will do what you want. (If so, squareform may also be useful.)

Find distance between one point and a subset of other points.

See if the pdist function will do what you want. (If so, squareform may also be useful.)

ongeveer 19 uur ago | 0

Answered

detrending timeseries by removing the linear function fitted by samples?

Considering that the objective is to remove a linear trend, perhaps the easiest way would be: t = 11:22; p = polyfit(x(t),tac...

detrending timeseries by removing the linear function fitted by samples?

Considering that the objective is to remove a linear trend, perhaps the easiest way would be: t = 11:22; p = polyfit(x(t),tac...

ongeveer 19 uur ago | 0

| accepted

Answered

Find peak and plot graph from peak

I am not certain what you want to do. If you want to get the peaks and their indices, request those outputs: [pks,locs] = f...

Find peak and plot graph from peak

I am not certain what you want to do. If you want to get the peaks and their indices, request those outputs: [pks,locs] = f...

ongeveer 21 uur ago | 0

Answered

How can I define a gradient function that can update k values after each iteration to optimize parameters in ODEs?

One option is the approach in Parameter Estimation for a System of Differential Equations. You will need to modify the ‘kinetic...

How can I define a gradient function that can update k values after each iteration to optimize parameters in ODEs?

One option is the approach in Parameter Estimation for a System of Differential Equations. You will need to modify the ‘kinetic...

ongeveer 23 uur ago | 0

Answered

How to draw bar graph of different colors ?

Try this: y = [280 260 240]; figure c = bar(y); set(gca, 'XTickLabel',{'CS0','CS10','CS20'}) xlabel('Wt% of cenospheres'...

How to draw bar graph of different colors ?

Try this: y = [280 260 240]; figure c = bar(y); set(gca, 'XTickLabel',{'CS0','CS10','CS20'}) xlabel('Wt% of cenospheres'...

ongeveer 24 uur ago | 0

Answered

Problem to get the right format of a Surf Plot

It looks as though ‘X’ is not sorted. Without the data a guess would be this possible solution: BB = sortrows (BB,1); See th...

Problem to get the right format of a Surf Plot

It looks as though ‘X’ is not sorted. Without the data a guess would be this possible solution: BB = sortrows (BB,1); See th...

1 dag ago | 0

| accepted

Answered

How to linearly fit a semilog graph

Try this: D1 = readmatrix('Data.xlsx'); x = D1(:,1); y = D1(:,2); [ymax,idx] = max(y); idxrng = idx:numel(y); objfcn ...

How to linearly fit a semilog graph

Try this: D1 = readmatrix('Data.xlsx'); x = D1(:,1); y = D1(:,2); [ymax,idx] = max(y); idxrng = idx:numel(y); objfcn ...

1 dag ago | 0

Answered

I don't understand why the elements are not the same on both sides

The reason is that ‘t’ needs a subscript: x(n+1) = x(n) + h * ((8*(x(n))/(t(n)+1))-(t+1)*(x(n)^2)); ...

I don't understand why the elements are not the same on both sides

The reason is that ‘t’ needs a subscript: x(n+1) = x(n) + h * ((8*(x(n))/(t(n)+1))-(t+1)*(x(n)^2)); ...

1 dag ago | 0

| accepted

Answered

Adding a new column to a table

One approach: T1 = table(randi([330 470],10,1), 'VariableNames',{'QTcorrected'}); % Create Data QTc = @(x) 1*...

Adding a new column to a table

One approach: T1 = table(randi([330 470],10,1), 'VariableNames',{'QTcorrected'}); % Create Data QTc = @(x) 1*...

3 dagen ago | 0

| accepted

Answered

How to Segment EMG data into time intervals

One option is the Signal Processing Toolbox buffer function. It uses samples as one of its arguments, however that is straigh...

How to Segment EMG data into time intervals

One option is the Signal Processing Toolbox buffer function. It uses samples as one of its arguments, however that is straigh...

3 dagen ago | 0

| accepted

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...

3 dagen ago | 0

| accepted

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...

3 dagen 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)...

3 dagen 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...

3 dagen ago | 0

Answered

confusing error message: '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...

confusing error message: '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...

3 dagen ago | 0

| accepted

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...

4 dagen 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.

4 dagen 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)...

5 dagen 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...

5 dagen 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...

5 dagen 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);...

5 dagen 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...

5 dagen 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*...

5 dagen 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 ...

5 dagen 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...

5 dagen 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...

6 dagen ago | 0