10,199 total contributions since 2012

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

Solving a System of ODEs

Try this: ... %Initial Conditions condx1 = x(0) == 1; condy1 = y(0) == 1; condz1 = z(0) == 0; %Soluti...

Solving a System of ODEs

Try this: ... %Initial Conditions condx1 = x(0) == 1; condy1 = y(0) == 1; condz1 = z(0) == 0; %Soluti...

3 hours ago | 0

Answered

please help me plotting the curve. Its working fine till second last line but not plotting the curve.

You have not defined *|‘A’|*, so it is not possible to evaluate *|‘P’|* in order to plot it. Changing your code slightly: ...

please help me plotting the curve. Its working fine till second last line but not plotting the curve.

You have not defined *|‘A’|*, so it is not possible to evaluate *|‘P’|* in order to plot it. Changing your code slightly: ...

8 hours ago | 0

| accepted

Answered

Looping ode45 Increasing Parameter

You did not post your constants, so I cannot run your code. Most likely, you need to subscript *|‘mp’|* in your *|‘odefun’|...

Looping ode45 Increasing Parameter

You did not post your constants, so I cannot run your code. Most likely, you need to subscript *|‘mp’|* in your *|‘odefun’|...

1 day ago | 0

Answered

how to plot a color-coded matrix

Try this: a=[1 0 3;1 1 4;1 2 4;1 3 5] x=a(:,1); y=a(:,2); z=a(:,3); L1 = (z > 1) & (z <= 3); ...

how to plot a color-coded matrix

Try this: a=[1 0 3;1 1 4;1 2 4;1 3 5] x=a(:,1); y=a(:,2); z=a(:,3); L1 = (z > 1) & (z <= 3); ...

1 day ago | 0

| accepted

Answered

Problem on code while plotting a graph

The actual error is most likely in the line just above your *|title|* call. Check it to be certain it is entered correctly....

Problem on code while plotting a graph

The actual error is most likely in the line just above your *|title|* call. Check it to be certain it is entered correctly....

1 day ago | 0

| accepted

Answered

fprintf and arrays of varying length

The *|fprintf|* (and *|sprintf|*) functions will do that by default: A = [1 1 1 1 1]; fprintf('%2d', A) fprintf('\n'...

fprintf and arrays of varying length

The *|fprintf|* (and *|sprintf|*) functions will do that by default: A = [1 1 1 1 1]; fprintf('%2d', A) fprintf('\n'...

1 day ago | 2

Answered

How to plot multivariable functions against each other?

Vectorize all the vector multiplications and divisions, and it works: GF = (kagf * (kdap1 * x - vs2ap1 * (y / (kafak + y))...

How to plot multivariable functions against each other?

Vectorize all the vector multiplications and divisions, and it works: GF = (kagf * (kdap1 * x - vs2ap1 * (y / (kafak + y))...

1 day ago | 0

| accepted

Answered

Matlab Error (Z must be a matrix, not a scalar or vector.)?

When you call *|meshgrid|* with *|3|* vectors, it returns *|3D|* matrices for all the outputs. The error message is slightly mi...

Matlab Error (Z must be a matrix, not a scalar or vector.)?

When you call *|meshgrid|* with *|3|* vectors, it returns *|3D|* matrices for all the outputs. The error message is slightly mi...

2 days ago | 0

Answered

ode45 + lsqcurvefit- multiple ODEs

Similar to <https://www.mathworks.com/matlabcentral/answers/43439-monod-kinetics-and-curve-fitting *Monod kinetics and curve fit...

ode45 + lsqcurvefit- multiple ODEs

Similar to <https://www.mathworks.com/matlabcentral/answers/43439-monod-kinetics-and-curve-fitting *Monod kinetics and curve fit...

2 days ago | 0

| accepted

Answered

Use logical values to extract a matrix not a vector?

This will work for *_this particular problem_* and perhaps for similar situations. It will not work generically: A = M.*l...

Use logical values to extract a matrix not a vector?

This will work for *_this particular problem_* and perhaps for similar situations. It will not work generically: A = M.*l...

2 days ago | 0

Answered

Plotting datapoint as you calculate them

Try these: figure(1) x=-1; while(x<1) y=sqrt(1-(x^2)); plot(x,y,'p') axis([0 2 0 1.5]) ...

Plotting datapoint as you calculate them

Try these: figure(1) x=-1; while(x<1) y=sqrt(1-(x^2)); plot(x,y,'p') axis([0 2 0 1.5]) ...

4 days ago | 0

| accepted

Answered

Fit curve to nonstandard data

I am not certain what you want to do. The problem is that you have several sets of data in each vector, so taking the unique *|...

Fit curve to nonstandard data

I am not certain what you want to do. The problem is that you have several sets of data in each vector, so taking the unique *|...

5 days ago | 0

Answered

How can I filter this figure ?

If you have *|R2018a|*, use the <https://www.mathworks.com/help/signal/ref/bandpass.html *|bandpass|*> (link) function to design...

How can I filter this figure ?

If you have *|R2018a|*, use the <https://www.mathworks.com/help/signal/ref/bandpass.html *|bandpass|*> (link) function to design...

6 days ago | 0

| accepted

Answered

Transform into a Matlab datetime format, Part 2 (Sample File Attached)

Try this: TestTbl = readtable('Test.csv'); DT = datetime(TestTbl{:,1}, 'InputFormat','MM/dd/yyyy', 'Format','MM/dd/...

Transform into a Matlab datetime format, Part 2 (Sample File Attached)

Try this: TestTbl = readtable('Test.csv'); DT = datetime(TestTbl{:,1}, 'InputFormat','MM/dd/yyyy', 'Format','MM/dd/...

6 days ago | 0

| accepted

Answered

Mupad will not start

See: <https://www.mathworks.com/matlabcentral/answers/399991-syms-sym-and-mupad-functions-cause-matlab-to-freeze *"syms", "sym",...

Mupad will not start

See: <https://www.mathworks.com/matlabcentral/answers/399991-syms-sym-and-mupad-functions-cause-matlab-to-freeze *"syms", "sym",...

6 days ago | 0

| accepted

Answered

Surface plot using multiple excel files

I just now read your email to me. (Normally, I do not reply to them.) You probably do not need the loop. The *|fft|* func...

Surface plot using multiple excel files

I just now read your email to me. (Normally, I do not reply to them.) You probably do not need the loop. The *|fft|* func...

6 days ago | 0

Answered

Find the mean of values in a column when a condition is met

Try this: M = randi(9, 10, 3) % Create Matrix someValue = 3 ...

Find the mean of values in a column when a condition is met

Try this: M = randi(9, 10, 3) % Create Matrix someValue = 3 ...

7 days ago | 0

| accepted

Answered

Why is it that their is error in plotting a 2D plot?

You have a script called *|‘plot.m’|*, apparently in your user directory. Rename your *|‘plot.m’|* script something different, ...

Why is it that their is error in plotting a 2D plot?

You have a script called *|‘plot.m’|*, apparently in your user directory. Rename your *|‘plot.m’|* script something different, ...

7 days ago | 0

Answered

How to obtain peaks in the y-axis above a reference line in matlab plot

If you have the Signal Processing Toolbox, use the <https://www.mathworks.com/help/signal/ref/findpeaks.html *|findpeaks|*> (lin...

How to obtain peaks in the y-axis above a reference line in matlab plot

If you have the Signal Processing Toolbox, use the <https://www.mathworks.com/help/signal/ref/findpeaks.html *|findpeaks|*> (lin...

8 days ago | 0

Answered

FFT plot how to plot frequency

I would create the frequency vector *|‘Fv’|* as: Ts = mean(diff(T)); % Sampling In...

FFT plot how to plot frequency

I would create the frequency vector *|‘Fv’|* as: Ts = mean(diff(T)); % Sampling In...

8 days ago | 0

Answered

Plot system of ODE in 22 variables.

The spaces in the individual rows are most likely causing the problem, for example in: ...; (k1*x(2)*x(1)-r1*x(3))- 2*(k2*x...

Plot system of ODE in 22 variables.

The spaces in the individual rows are most likely causing the problem, for example in: ...; (k1*x(2)*x(1)-r1*x(3))- 2*(k2*x...

8 days ago | 1

| accepted

Answered

Finding values of Lambert's W function for x>0

Solve this the same way you solved the Bessel function, this time without the loop. Think of it this way: You want to find:...

Finding values of Lambert's W function for x>0

Solve this the same way you solved the Bessel function, this time without the loop. Think of it this way: You want to find:...

9 days ago | 1

Answered

Representation of Y axis grid

See the section on <https://www.mathworks.com/help/matlab/creating_plots/change-tick-marks-and-tick-labels-of-graph-1.html#d119e...

Representation of Y axis grid

See the section on <https://www.mathworks.com/help/matlab/creating_plots/change-tick-marks-and-tick-labels-of-graph-1.html#d119e...

9 days ago | 0

| accepted

Answered

How can i reorder NxM matrix into a 1D array

Using the <https://www.mathworks.com/help/matlab/ref/reshape.html *|reshape|*> (link) function: b = reshape(a([3 2 1],:)',...

How can i reorder NxM matrix into a 1D array

Using the <https://www.mathworks.com/help/matlab/ref/reshape.html *|reshape|*> (link) function: b = reshape(a([3 2 1],:)',...

9 days ago | 1

| accepted

Answered

How can I integrate this function to give a symbolic expression?

It will not give you a symbolic expression because you are not using the Symbolic Math Toolbox to integrate it. (That would lik...

How can I integrate this function to give a symbolic expression?

It will not give you a symbolic expression because you are not using the Symbolic Math Toolbox to integrate it. (That would lik...

9 days ago | 1

| accepted

Answered

How to compare column A and B based on the column C condition?

Try this: A = [1 7 0; 4 2 1;8 2 1; 2 4 1; 9 4 0]; C3 = A(:,3) == 1; % Log...

How to compare column A and B based on the column C condition?

Try this: A = [1 7 0; 4 2 1;8 2 1; 2 4 1; 9 4 0]; C3 = A(:,3) == 1; % Log...

9 days ago | 0

| accepted

Answered

I couldn't find what is wrong with this solution. Can you help me?

The *|fzero|* function will only find one root on each interval. You will need to use a loop and have *|fzero|* begin with a di...

I couldn't find what is wrong with this solution. Can you help me?

The *|fzero|* function will only find one root on each interval. You will need to use a loop and have *|fzero|* begin with a di...

9 days ago | 1

| accepted

Answered

reading the data from a csv file with headers

If you have *|R2013b|* or later, use the <https://www.mathworks.com/help/matlab/ref/readtable.html *|readtable|*> (link) functio...

reading the data from a csv file with headers

If you have *|R2013b|* or later, use the <https://www.mathworks.com/help/matlab/ref/readtable.html *|readtable|*> (link) functio...

9 days ago | 0

| accepted

Answered

How do I transform this Digital filter to analog

Easiest: [ns,ds] = cheby2(n,rs,wn,'bandpass','s'); Then use *|freqs|* instead of *|freqz|*.

How do I transform this Digital filter to analog

Easiest: [ns,ds] = cheby2(n,rs,wn,'bandpass','s'); Then use *|freqs|* instead of *|freqz|*.

10 days ago | 0

Answered

How do I fix: Index exceeds array bounds.

If you want to increment *|‘j’|* inside the *|‘l’|* loop, the easiuest way is to reverse the order of the *|for|* calls: ...

How do I fix: Index exceeds array bounds.

If you want to increment *|‘j’|* inside the *|‘l’|* loop, the easiuest way is to reverse the order of the *|for|* calls: ...

10 days ago | 1