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

Vary a parameter and plot the output

Try this: function main x0 = [500 500 500 500 5 5]; opt = optimset('Display','off'); % 'display', 'iter' I = [500 550 600 ...

Vary a parameter and plot the output

Try this: function main x0 = [500 500 500 500 5 5]; opt = optimset('Display','off'); % 'display', 'iter' I = [500 550 600 ...

10 hours ago | 0

| accepted

Answered

How do I avoid using a lot of if statements in a row?

Another option is switch,case,otherwise. You will need to determine if that is an improvement over the multiple if blocks.

How do I avoid using a lot of if statements in a row?

Another option is switch,case,otherwise. You will need to determine if that is an improvement over the multiple if blocks.

11 hours ago | 0

Answered

Stability Analysis (Dertermining the Limit Cycle)

The phase portrait is usually plotted as the function against its derivative. Use the gradient function to calculate the deriva...

Stability Analysis (Dertermining the Limit Cycle)

The phase portrait is usually plotted as the function against its derivative. Use the gradient function to calculate the deriva...

11 hours ago | 0

| accepted

Answered

Peak to Peak Value of Sinusoidal Grad

Use the islocalmax function to find the maxima, islocalmin to find the minima, and go from there. (These functions were introdu...

Peak to Peak Value of Sinusoidal Grad

Use the islocalmax function to find the maxima, islocalmin to find the minima, and go from there. (These functions were introdu...

1 day ago | 0

Answered

Solve numerically a system of first-order differential equations

Create the function symbolically: syms a b c d e f g t x(t) y(t) z(t) T Y Dx = diff(x); Dy = diff(y); Dz = diff(z); Eqn1 ...

Solve numerically a system of first-order differential equations

Create the function symbolically: syms a b c d e f g t x(t) y(t) z(t) T Y Dx = diff(x); Dy = diff(y); Dz = diff(z); Eqn1 ...

1 day ago | 1

| accepted

Answered

Finding Angular Frequency of an Oscillation

Likely the easiest way would be to find the times of the positive peaks, then calculate from there: [pks,pktimes] = findpeaks(...

Finding Angular Frequency of an Oscillation

Likely the easiest way would be to find the times of the positive peaks, then calculate from there: [pks,pktimes] = findpeaks(...

1 day ago | 1

| accepted

Answered

filter a timetable by day

I am not certain what you intend by ‘groups’. One option is to use the retime function: TTRT = retime(TT, 'daily','mean') ...

filter a timetable by day

I am not certain what you intend by ‘groups’. One option is to use the retime function: TTRT = retime(TT, 'daily','mean') ...

1 day ago | 0

| accepted

Answered

how do i keep the format of xticklabels?

Use compose or sprintfc to create the cell array of labels: figure plot(0:6, rand(1,7)) xtl = sprintfc('%d',10.^(0:6)); xtl...

how do i keep the format of xticklabels?

Use compose or sprintfc to create the cell array of labels: figure plot(0:6, rand(1,7)) xtl = sprintfc('%d',10.^(0:6)); xtl...

2 days ago | 0

| accepted

Answered

creating plane piecewise in one plot

Try this: f = @(x) (3*x).*((0<x) & (x<=1)) + (2*x+1).*((1<x) & (x<=2)) + (6*x+1).*((2<x) & (x<=3)); x = linspace(0, 3); ...

creating plane piecewise in one plot

Try this: f = @(x) (3*x).*((0<x) & (x<=1)) + (2*x+1).*((1<x) & (x<=2)) + (6*x+1).*((2<x) & (x<=3)); x = linspace(0, 3); ...

2 days ago | 0

Answered

Shading the Standard Deviation

Try this (obviously with your data, not my simulated vectors): x = 1:50; ...

Shading the Standard Deviation

Try this (obviously with your data, not my simulated vectors): x = 1:50; ...

2 days ago | 1

Answered

"dsolve" gives some extra terms in the solution

Tell simplify to keep simplifying until it either meets the iteration limit or cannot simplify the expression further: Vs= sim...

"dsolve" gives some extra terms in the solution

Tell simplify to keep simplifying until it either meets the iteration limit or cannot simplify the expression further: Vs= sim...

2 days ago | 0

Answered

Nans values in time series

You must decide that. There are methods to interpolate the NaN values if you want to do that, one of which is the fillmissing...

Nans values in time series

You must decide that. There are methods to interpolate the NaN values if you want to do that, one of which is the fillmissing...

3 days ago | 0

Answered

How can I solve an equation containing log ?

Use the fsolve function, because it will return complex results, and since the argument to the log function is negative it will ...

How can I solve an equation containing log ?

Use the fsolve function, because it will return complex results, and since the argument to the log function is negative it will ...

3 days ago | 0

Answered

How to find maximum of a function of 2 variables

One approach: z = @(x,y) cos(x.^2 + y.^2); XY = fminsearch(@(b)norm(-z(b(1),b(2))), [3; 3]) producing: XY = 2...

How to find maximum of a function of 2 variables

One approach: z = @(x,y) cos(x.^2 + y.^2); XY = fminsearch(@(b)norm(-z(b(1),b(2))), [3; 3]) producing: XY = 2...

3 days ago | 1

| accepted

Answered

convert a transfer function to controllable and observable canonical form

num = [4]; den = [1 0.8 4]; Gp = tf (num , den); The canon function requesting the 'companion' canonical form directly produc...

convert a transfer function to controllable and observable canonical form

num = [4]; den = [1 0.8 4]; Gp = tf (num , den); The canon function requesting the 'companion' canonical form directly produc...

3 days ago | 1

| accepted

Answered

why do I get "Undefined function or variable 'tspan'."

The code defines that variable as ‘timespan’. The argument names and the varialble names must always match. Try this: [t,z...

why do I get "Undefined function or variable 'tspan'."

The code defines that variable as ‘timespan’. The argument names and the varialble names must always match. Try this: [t,z...

4 days ago | 1

| accepted

Answered

How to graph values of a function above and below 0 as separate functions?

Subscript the elements and provide corresponding time vectors for each one: t= 0:0.2:3*pi; y=sin(t); for k = 1:numel(t) ...

How to graph values of a function above and below 0 as separate functions?

Subscript the elements and provide corresponding time vectors for each one: t= 0:0.2:3*pi; y=sin(t); for k = 1:numel(t) ...

4 days ago | 1

Answered

How can I combine several file.fig together

For each .fig file: F = openfig(filename); Lines = findobj(F, 'Type','Line'); Then, for each element of the ‘Lines’ array: ...

How can I combine several file.fig together

For each .fig file: F = openfig(filename); Lines = findobj(F, 'Type','Line'); Then, for each element of the ‘Lines’ array: ...

4 days ago | 0

| accepted

Answered

Use entries of symbolic array outside of the array

The reason is that the elements of ‘X’ are stored as matrix elements. The individual elements exist only as matrix elements, no...

Use entries of symbolic array outside of the array

The reason is that the elements of ‘X’ are stored as matrix elements. The individual elements exist only as matrix elements, no...

4 days ago | 0

| accepted

Answered

What should the order of my FIR filter be?

The fir2 function documentation appears to favour even-numbered filter orders. (The only MATLAB functions that I know of that c...

What should the order of my FIR filter be?

The fir2 function documentation appears to favour even-numbered filter orders. (The only MATLAB functions that I know of that c...

5 days ago | 0

Answered

Finding and Graphing FWHM (Trouble with Find Function)

Without ‘data_10micronslit.txt’, it is impossible to provide a specific solution. However the findpeaks function will return th...

Finding and Graphing FWHM (Trouble with Find Function)

Without ‘data_10micronslit.txt’, it is impossible to provide a specific solution. However the findpeaks function will return th...

5 days ago | 0

Answered

Extend linear regression line to an offset

I am not certain what you are asking. Two possibilities: X = [0.6,1.6,2.6,3.6,4.6,5.6,]; Y = [23500, 87780, 153651, 220054...

Extend linear regression line to an offset

I am not certain what you are asking. Two possibilities: X = [0.6,1.6,2.6,3.6,4.6,5.6,]; Y = [23500, 87780, 153651, 220054...

5 days ago | 0

Answered

Can someone please help?

There are some problems. First, ‘pv’ is not a function of ‘phi’, at least as written. Second, use element-wise operations ...

Can someone please help?

There are some problems. First, ‘pv’ is not a function of ‘phi’, at least as written. Second, use element-wise operations ...

6 days ago | 0

Answered

How to filter a signal with lowpass/highpass?

The easiest way to determine the sampling frequency is to measure it: D = load('trial1.mat'); A = D.Intensity; t = D.Time; ...

How to filter a signal with lowpass/highpass?

The easiest way to determine the sampling frequency is to measure it: D = load('trial1.mat'); A = D.Intensity; t = D.Time; ...

6 days ago | 1

| accepted

Answered

Creating PTn transfer function by

To fit them in the time domain: syms k s T TF1 = k/(T*s+1); TF2 = k/(T*s+1)^2; TF3 = k/(T*s+1)^3; TF1t = ilaplace(TF1);...

Creating PTn transfer function by

To fit them in the time domain: syms k s T TF1 = k/(T*s+1); TF2 = k/(T*s+1)^2; TF3 = k/(T*s+1)^3; TF1t = ilaplace(TF1);...

6 days ago | 0

| accepted

Answered

I am not getting the solution for my coding.

Try this corrected version of your code: syms q B P S=6; D=4800; A=25; Delta=0.2; F=50; V=1; d=50; tow=0.1; M=7250; ...

I am not getting the solution for my coding.

Try this corrected version of your code: syms q B P S=6; D=4800; A=25; Delta=0.2; F=50; V=1; d=50; tow=0.1; M=7250; ...

6 days ago | 1

Answered

New Script keeps opening in new window instead of a tab

See: New Script keeps opening in new window instead of a tab

New Script keeps opening in new window instead of a tab

See: New Script keeps opening in new window instead of a tab

6 days ago | 0

| accepted

Answered

Error with accumarray code

For some reason, accumarray doesn’t like the findgroups ‘G’, at least here. I have no idea why it throws those errors, since al...

Error with accumarray code

For some reason, accumarray doesn’t like the findgroups ‘G’, at least here. I have no idea why it throws those errors, since al...

7 days ago | 1

| accepted