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

If i am trying to save each iteration of the matrix in a for loop to add them together at the end. How would I do that? I understand it will print each iteration of the matrix but I haven't figured out how to save each iteration and sum them all up.

I can’t run your code. Try this: QBar(:,:,N) =[QBar11 QBar12 QBar16; QBar12 QBar22 QBar26; QBar16 QBar26 QBar66]; To sum t...

If i am trying to save each iteration of the matrix in a for loop to add them together at the end. How would I do that? I understand it will print each iteration of the matrix but I haven't figured out how to save each iteration and sum them all up.

I can’t run your code. Try this: QBar(:,:,N) =[QBar11 QBar12 QBar16; QBar12 QBar22 QBar26; QBar16 QBar26 QBar66]; To sum t...

7 hours ago | 0

Answered

Add parameters in transfer function

The ‘H’ transfer function and the feedback output function can be anonymous functions: G = tf(1, [2 0 1]) H = @(k_s) tf(1, [k...

Add parameters in transfer function

The ‘H’ transfer function and the feedback output function can be anonymous functions: G = tf(1, [2 0 1]) H = @(k_s) tf(1, [k...

15 hours ago | 0

Answered

matlab calculates cosine different from my calculator

Your calculator is calculating in degrees. By default MATLAB calculates in radians: MATLAB = cos(1) Calculator = cosd(1) pr...

matlab calculates cosine different from my calculator

Your calculator is calculating in degrees. By default MATLAB calculates in radians: MATLAB = cos(1) Calculator = cosd(1) pr...

19 hours ago | 3

| accepted

Answered

Problem with get the equation of the signal.

I am not certain what you intend by ‘equation’. One possibility is to get the frequency components, so you can express it as ...

Problem with get the equation of the signal.

I am not certain what you intend by ‘equation’. One possibility is to get the frequency components, so you can express it as ...

20 hours ago | 0

Answered

Parameter estimation using ODE

Your ‘kinetics’ function has 9 parameters, so ‘theta0’ must have 9 elements. You have defined it as having 6.

Parameter estimation using ODE

Your ‘kinetics’ function has 9 parameters, so ‘theta0’ must have 9 elements. You have defined it as having 6.

1 day ago | 0

| accepted

Answered

Parameter Estimation of 3 ODE systems with lsqcurvefit does not converge

First, re-define ‘alpha0’ to include the initial conditions:: alpha0 = [alpha0; 80.2;4.451e-3;4.264e-3]; and change ‘kinetics...

Parameter Estimation of 3 ODE systems with lsqcurvefit does not converge

First, re-define ‘alpha0’ to include the initial conditions:: alpha0 = [alpha0; 80.2;4.451e-3;4.264e-3]; and change ‘kinetics...

1 day ago | 1

| accepted

Answered

Random Non-periodic waveform

Try this: C = {[1.54,2.49], [4.97,5.88], [6.69,7.98], [8.05,8.25],[8.58,9.09], [10.48,10.86], [11.16,12.97], [14.51,15.24],[15...

Random Non-periodic waveform

Try this: C = {[1.54,2.49], [4.97,5.88], [6.69,7.98], [8.05,8.25],[8.58,9.09], [10.48,10.86], [11.16,12.97], [14.51,15.24],[15...

1 day ago | 1

| accepted

Answered

Find repeating values of the same numbers

One approach is to use the intersect function: G1 = [9 30 36 38 43 54 59]; G2 = [7 29 30 41 50 54 59]; G1G2 = intersect(G1,G...

Find repeating values of the same numbers

One approach is to use the intersect function: G1 = [9 30 36 38 43 54 59]; G2 = [7 29 30 41 50 54 59]; G1G2 = intersect(G1,G...

2 days ago | 0

Answered

How to make three dimensional gragh

Try this: x = (1:10)'; y = [10 10 9 8 8 7 6 6 5 5; 9 8 7 6 6 5 4 4 4 4; 12 10 9 9 9 9 6 6 5 5]'; figure hol...

How to make three dimensional gragh

Try this: x = (1:10)'; y = [10 10 9 8 8 7 6 6 5 5; 9 8 7 6 6 5 4 4 4 4; 12 10 9 9 9 9 6 6 5 5]'; figure hol...

2 days ago | 0

| accepted

Answered

Should I use 1-D digital filtering or lowpass filter ?

Yes. Also be certain that the signals have uniform sampling intervals. If they do not, use the resample function to force them...

Should I use 1-D digital filtering or lowpass filter ?

Yes. Also be certain that the signals have uniform sampling intervals. If they do not, use the resample function to force them...

2 days ago | 1

| accepted

Answered

Can someone explain how this line in the code works?

The fzero call indicates that the code is to find the value of the ‘quintic’ function argument such that the function value equa...

Can someone explain how this line in the code works?

The fzero call indicates that the code is to find the value of the ‘quintic’ function argument such that the function value equa...

3 days ago | 0

| accepted

Answered

Apply a bandpass filter in freq domain

‘So I think I need to apply a bandpass filter in freq domain.’ Don’t. That is extremely difficult, since the Fourier transform...

Apply a bandpass filter in freq domain

‘So I think I need to apply a bandpass filter in freq domain.’ Don’t. That is extremely difficult, since the Fourier transform...

3 days ago | 0

Answered

Problems fitting couple differential equations to experimental data

Running your code with random data ran without error (R2020a): t = (0:20)'; f = rand(size(t)); function [x] = knfit(t,f) ...

Problems fitting couple differential equations to experimental data

Running your code with random data ran without error (R2020a): t = (0:20)'; f = rand(size(t)); function [x] = knfit(t,f) ...

3 days ago | 0

Answered

How to get functions out of inputdlg

I would do something like this, using str2func and vectorize: questions = {'Enter a function of ‘x’','Enter a lower limit','En...

How to get functions out of inputdlg

I would do something like this, using str2func and vectorize: questions = {'Enter a function of ‘x’','Enter a lower limit','En...

3 days ago | 1

| accepted

Answered

error using ODE45 to solve a 2nd order ODE

Note that psi is the polygamma function. The code ‘overshadows’ that function with the variable name. The actual problem i...

error using ODE45 to solve a 2nd order ODE

Note that psi is the polygamma function. The code ‘overshadows’ that function with the variable name. The actual problem i...

3 days ago | 0

| accepted

Answered

1D cable model

You are calculating ‘N’ and ‘TI’. They may appear to be integers, however they are not. The solution to that is to force them ...

1D cable model

You are calculating ‘N’ and ‘TI’. They may appear to be integers, however they are not. The solution to that is to force them ...

3 days ago | 0

Answered

Finding membrane time constant from a graph

Try adding this line to your code (after the loop): tau_Vm_num = interp1(Vm_num, time, 0.632*max(Vm_num)); so the entire code...

Finding membrane time constant from a graph

Try adding this line to your code (after the loop): tau_Vm_num = interp1(Vm_num, time, 0.632*max(Vm_num)); so the entire code...

4 days ago | 0

| accepted

Answered

response spectrum - time domain to frequency domain

Here is some example code that you can adapt to your data: t = linspace(0, 5, 1E+4); ...

response spectrum - time domain to frequency domain

Here is some example code that you can adapt to your data: t = linspace(0, 5, 1E+4); ...

4 days ago | 0

Answered

Function handle with integrals of multiple equations?

I get different result with a strictly numeric version: V1 = 230; P1 = 2.7; T1 = 300; V2 = 30; A = -0.703029; B = 108...

Function handle with integrals of multiple equations?

I get different result with a strictly numeric version: V1 = 230; P1 = 2.7; T1 = 300; V2 = 30; A = -0.703029; B = 108...

5 days ago | 0

Answered

Finding the index of x values to create an equally spaced array.

Your approach appears to be correct, as far as it goes. Use the interp1 function to create your result vector: x = 0:195; y ...

Finding the index of x values to create an equally spaced array.

Your approach appears to be correct, as far as it goes. Use the interp1 function to create your result vector: x = 0:195; y ...

5 days ago | 0

| accepted

Answered

Chebyshev type II filter

See the documentation for: cheb2ord, cheby2, zp2sos and filtfilt.

Chebyshev type II filter

See the documentation for: cheb2ord, cheby2, zp2sos and filtfilt.

5 days ago | 0

| accepted

Answered

Suppressing only part of a function output?

To have only ‘a’ and ‘b’ returned: [a,b] = myFun(d,e) and to have only ‘c’ returned: [~,~,c] = myFun(d,e) Use variations o...

Suppressing only part of a function output?

To have only ‘a’ and ‘b’ returned: [a,b] = myFun(d,e) and to have only ‘c’ returned: [~,~,c] = myFun(d,e) Use variations o...

5 days ago | 0

Answered

Is there a PDF for all Matlab Functions?

There are PDF documentation for MATLAB and separately for the Toolboxes and such. For the MATLAB collection click on: PDF Docum...

Is there a PDF for all Matlab Functions?

There are PDF documentation for MATLAB and separately for the Toolboxes and such. For the MATLAB collection click on: PDF Docum...

6 days ago | 0

Answered

How to solve system of differential equations with time dependent parameters?

As darova suggested, integrate it numerically. For some reason, ode45 does not like the anonymous functions and throws an ’Unde...

How to solve system of differential equations with time dependent parameters?

As darova suggested, integrate it numerically. For some reason, ode45 does not like the anonymous functions and throws an ’Unde...

6 days ago | 2

| accepted

Answered

Zero crossing for a curve fitting function(smoothing spline)

I don’t have the Curve Fitting Toolbox. (I only need it to reply to Answers Questions, and that’s not enough justification for ...

Zero crossing for a curve fitting function(smoothing spline)

I don’t have the Curve Fitting Toolbox. (I only need it to reply to Answers Questions, and that’s not enough justification for ...

6 days ago | 0

| accepted

Answered

Area under FFT curve

Calculate the areas of only the ‘positive frequencies’ half of the fft output, not the entire output. If the data are all posit...

Area under FFT curve

Calculate the areas of only the ‘positive frequencies’ half of the fft output, not the entire output. If the data are all posit...

6 days ago | 0

Answered

Need to solve the roots from a large equation

Use the correct values for ‘la’ and ‘n’, then this: syms k la = 42; n = pi; Eqn = 2*k - 2*k*n + (8*k^7*n^4 - 24*k^5*n^3 + ...

Need to solve the roots from a large equation

Use the correct values for ‘la’ and ‘n’, then this: syms k la = 42; n = pi; Eqn = 2*k - 2*k*n + (8*k^7*n^4 - 24*k^5*n^3 + ...

6 days ago | 0

Answered

Find Middle of square wave

Use the islocalmax function (R2017b and later): This code plots green upward-pointing triangles at the centre of each pulse: ...

Find Middle of square wave

Use the islocalmax function (R2017b and later): This code plots green upward-pointing triangles at the centre of each pulse: ...

7 days ago | 0

| accepted

Answered

Change color of a specific line in mesh

No exact solutions without your code and data. One approach: xv = -15:0.8:15; yv = -10:0.8:10; [X,Y] = ndgrid(xv, yv); z...

Change color of a specific line in mesh

No exact solutions without your code and data. One approach: xv = -15:0.8:15; yv = -10:0.8:10; [X,Y] = ndgrid(xv, yv); z...

7 days ago | 1

| accepted

Answered

Calculating efficiency using matlab

No loops needed: Tout = [323.2 326.0 328.8 331.6 334.3 337.1]; I = [500 550 600 650 700 750]; [Toutm,Im] = ndgrid(Tout,I...

Calculating efficiency using matlab

No loops needed: Tout = [323.2 326.0 328.8 331.6 334.3 337.1]; I = [500 550 600 650 700 750]; [Toutm,Im] = ndgrid(Tout,I...

7 days ago | 0

| accepted