9,762 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

How can I work out the median of frequency tables?

I would use the frequency vector *|‘B’|*, since it has the information you need. Try this: A = sort(rand(1, 35)); ...

How can I work out the median of frequency tables?

I would use the frequency vector *|‘B’|*, since it has the information you need. Try this: A = sort(rand(1, 35)); ...

2 hours ago | 0

Answered

Minimizing a multivariable function

Your code works for me as you posted it. (I added an *|end|* as the last line of the function, because I have a test function I...

Minimizing a multivariable function

Your code works for me as you posted it. (I added an *|end|* as the last line of the function, because I have a test function I...

2 hours ago | 0

Answered

how i plot 2 equations at different period in one graph?

Try this: x = @(t) (sqrt(2)*1.414*exp(-t).*sin(t+0.785)).*((0 < t) & (t < pi)) + (sqrt(2)*exp(-t).*sin(t+0.785)-exp(-t+pi)...

how i plot 2 equations at different period in one graph?

Try this: x = @(t) (sqrt(2)*1.414*exp(-t).*sin(t+0.785)).*((0 < t) & (t < pi)) + (sqrt(2)*exp(-t).*sin(t+0.785)-exp(-t+pi)...

15 hours ago | 0

| accepted

Answered

Using fminsearch to find least distance between 12 points

I can’t run your code since I don’t have your constants. Try this instead: x0=rand(2,1); Using *|0|* as an initial...

Using fminsearch to find least distance between 12 points

I can’t run your code since I don’t have your constants. Try this instead: x0=rand(2,1); Using *|0|* as an initial...

17 hours ago | 0

Answered

Plotting two linear equations

Use ‘logical indexing’: x = linspace(-5,2); f = @(x) (-1).*(x < -1) + (x.^2 + x).*((x >= -1) & (x < 2)); figure(...

Plotting two linear equations

Use ‘logical indexing’: x = linspace(-5,2); f = @(x) (-1).*(x < -1) + (x.^2 + x).*((x >= -1) & (x < 2)); figure(...

18 hours ago | 0

Answered

How to eliminate Nan

One option: x=[0.162071097716028 0 0.276531475376737 0 0.264268578570244 0.247172330667782 0.0276055958119857 0.0223509218...

How to eliminate Nan

One option: x=[0.162071097716028 0 0.276531475376737 0 0.264268578570244 0.247172330667782 0.0276055958119857 0.0223509218...

19 hours ago | 0

Answered

How to take RMS of every 10 values in a matrix and output this?

Try this: A = randi(9, 66000, 4); % Create Matrix Ar = reshape(A, [], 4, 10); ...

How to take RMS of every 10 values in a matrix and output this?

Try this: A = randi(9, 66000, 4); % Create Matrix Ar = reshape(A, [], 4, 10); ...

20 hours ago | 0

Answered

Hey guys. I am trying to solve the equation of motion for a 2D 2-point-vortex. Im not sure if i am doing it right and how to plot the answer system. Can anybody look at my script and give some advise? Im quite new to matlab

Your concept is correct. However you are not calculating the derivatives correctly. You have to step through your *|‘PtV’|* fu...

Hey guys. I am trying to solve the equation of motion for a 2D 2-point-vortex. Im not sure if i am doing it right and how to plot the answer system. Can anybody look at my script and give some advise? Im quite new to matlab

Your concept is correct. However you are not calculating the derivatives correctly. You have to step through your *|‘PtV’|* fu...

20 hours ago | 0

Answered

Hello! Tell me please, on the basis of what literature is the model made "Muscle Reflex Parameter Estimation" https://www.mathworks.com/help/sldo/examples/muscle-reflex-parameter-estimation.html?s_tid=srchtitle.

MathWorks usually cites the references it uses. This is a simple spring-mass-damper system that MathWorks may have developed it...

Hello! Tell me please, on the basis of what literature is the model made "Muscle Reflex Parameter Estimation" https://www.mathworks.com/help/sldo/examples/muscle-reflex-parameter-estimation.html?s_tid=srchtitle.

MathWorks usually cites the references it uses. This is a simple spring-mass-damper system that MathWorks may have developed it...

1 day ago | 0

| accepted

Answered

How to solve these differential equations?

You can set the equations up easily enough using the Symbolic Math Toolbox: syms C(r) T(r) beta gamma phi Y dC = diff(...

How to solve these differential equations?

You can set the equations up easily enough using the Symbolic Math Toolbox: syms C(r) T(r) beta gamma phi Y dC = diff(...

1 day ago | 0

Answered

How to display Intersection of two graphs

You need to create *|‘T_A’|* and *|‘T_R’|* as _anonymous functions_. After that, you can use *|fzero|* to calculate the interse...

How to display Intersection of two graphs

You need to create *|‘T_A’|* and *|‘T_R’|* as _anonymous functions_. After that, you can use *|fzero|* to calculate the interse...

1 day ago | 1

| accepted

Answered

Effects of parameter on oscillatory behaviour.

Leave *|‘Kc’|* as a symbolic variable. Then you can vary it in your *|fsurf|* call: A=2; %Cross Sectional Area of the Tan...

Effects of parameter on oscillatory behaviour.

Leave *|‘Kc’|* as a symbolic variable. Then you can vary it in your *|fsurf|* call: A=2; %Cross Sectional Area of the Tan...

1 day ago | 0

| accepted

Answered

How can I write a program that indicates a number if it is integer or not?

Use the <https://www.mathworks.com/help/matlab/ref/rem.html *|rem|*> (link) or *|mod|* (linked to in that page) functions. ...

How can I write a program that indicates a number if it is integer or not?

Use the <https://www.mathworks.com/help/matlab/ref/rem.html *|rem|*> (link) or *|mod|* (linked to in that page) functions. ...

2 days ago | 0

Answered

My fitness function for timetabling in ga

You need to subscript the *|‘x’|* variables, since they are elements of a vector. You can also create *|‘my_fun’|* as an an...

My fitness function for timetabling in ga

You need to subscript the *|‘x’|* variables, since they are elements of a vector. You can also create *|‘my_fun’|* as an an...

2 days ago | 0

| accepted

Answered

Curve fitting with 3 variables

There are several ways, depending on what you want to do. I would begin with the Statistics and Machine Learning Toolbox <https...

Curve fitting with 3 variables

There are several ways, depending on what you want to do. I would begin with the Statistics and Machine Learning Toolbox <https...

2 days ago | 0

Answered

How to search a word both uppercase and lowercase given a specified string?

The <https://www.mathworks.com/help/matlab/ref/regexpi.html *|regexpi|*> (link) function is the _case-insensitive_ version of *|...

How to search a word both uppercase and lowercase given a specified string?

The <https://www.mathworks.com/help/matlab/ref/regexpi.html *|regexpi|*> (link) function is the _case-insensitive_ version of *|...

2 days ago | 0

| accepted

Answered

How to continue the matrix pattern

I can barely read your code and I can’t run the image you posted. That aside, the <https://www.mathworks.com/help/matlab/re...

How to continue the matrix pattern

I can barely read your code and I can’t run the image you posted. That aside, the <https://www.mathworks.com/help/matlab/re...

2 days ago | 0

Answered

How to solve equations with data stored in a cell arrays

I would simply do this: syms a Ind = 13; Rs = 5; Ind = 0:3:15; for i = 1:numel(Ind) Sol{i} = solve((a/...

How to solve equations with data stored in a cell arrays

I would simply do this: syms a Ind = 13; Rs = 5; Ind = 0:3:15; for i = 1:numel(Ind) Sol{i} = solve((a/...

3 days ago | 0

Answered

How to set all elements of a matrix that meet a certain criteria to NaN?

Try this: A(A > 1E+20) = NaN;

How to set all elements of a matrix that meet a certain criteria to NaN?

Try this: A(A > 1E+20) = NaN;

3 days ago | 0

| accepted

Answered

Fitting equation to data points

Try this: fy = @(L,Vr,x) (L./Vr)-((L./4.316).*cosd(x)); x = [22.96, 88.2, 114.275, 85.3]; y = [0.1422, 0.157967,...

Fitting equation to data points

Try this: fy = @(L,Vr,x) (L./Vr)-((L./4.316).*cosd(x)); x = [22.96, 88.2, 114.275, 85.3]; y = [0.1422, 0.157967,...

3 days ago | 1

| accepted

Answered

How to plot solid concentric circles in a meshgrid?

Try this: theta = linspace(0, 2*pi, 100); [X, Y] = meshgrid(1:1:4, theta); a = 0; b = 0; figure(2) plot...

How to plot solid concentric circles in a meshgrid?

Try this: theta = linspace(0, 2*pi, 100); [X, Y] = meshgrid(1:1:4, theta); a = 0; b = 0; figure(2) plot...

3 days ago | 1

| accepted

Answered

Help with 3D-plotting?

Tweak *|figure(2)|* by adding a *|patch|* call: figure(2) u1 = double(u_1) u2 = double(u_2) syms r v colorma...

Help with 3D-plotting?

Tweak *|figure(2)|* by adding a *|patch|* call: figure(2) u1 = double(u_1) u2 = double(u_2) syms r v colorma...

3 days ago | 0

| accepted

Answered

How to quickly find the position of a value in a sorted column data?

Try this: V = linspace(-80, 45, 150); % Create Vector B = -78; idx = find(V <= B, 1, 'la...

How to quickly find the position of a value in a sorted column data?

Try this: V = linspace(-80, 45, 150); % Create Vector B = -78; idx = find(V <= B, 1, 'la...

3 days ago | 0

| accepted

Answered

how to mirror plot in x=4 axis

We do not give complete solutions to homework problems here. I present an approach to an analogous problem to give you a _h...

how to mirror plot in x=4 axis

We do not give complete solutions to homework problems here. I present an approach to an analogous problem to give you a _h...

4 days ago | 1

| accepted

Answered

How to plot line on surface object

*_‘Any suggestion?’_* Experiment with *|plot3|* instead of *|plot|* to plot a line on a *|3D|* plot. *_Example_ —* ...

How to plot line on surface object

*_‘Any suggestion?’_* Experiment with *|plot3|* instead of *|plot|* to plot a line on a *|3D|* plot. *_Example_ —* ...

4 days ago | 0

Answered

replace only nonzeroes with per-column text and value

Try this: data = [11,111; 0,222; 33,0; 0,0; 55,555]; strvct = sprintf('foo:%d\tbar:%d\n', data'); result = regexprep...

replace only nonzeroes with per-column text and value

Try this: data = [11,111; 0,222; 33,0; 0,0; 55,555]; strvct = sprintf('foo:%d\tbar:%d\n', data'); result = regexprep...

4 days ago | 0

Answered

How can I use symbolic variables

Try this: rp = sym('rp',[1 10]); for n=1:10 a(n)=sqrt(n*3-1/n); c(n)=a(n)/rp(n); end

How can I use symbolic variables

Try this: rp = sym('rp',[1 10]); for n=1:10 a(n)=sqrt(n*3-1/n); c(n)=a(n)/rp(n); end

4 days ago | 1

| accepted

Answered

Using datetime data for x axis, I have an area plot on the whole x axis and I create a fill area for [x1 x2] to highlight a specific part of the graph. Fill created is over area plot and modifies its color. So how can I have fill plot in background?

This actually has a straightforward solution. Draw the ‘highlighting’ *|fill|* or *|patch|* object to *_exclude_* the original ...

Using datetime data for x axis, I have an area plot on the whole x axis and I create a fill area for [x1 x2] to highlight a specific part of the graph. Fill created is over area plot and modifies its color. So how can I have fill plot in background?

This actually has a straightforward solution. Draw the ‘highlighting’ *|fill|* or *|patch|* object to *_exclude_* the original ...

4 days ago | 0

Answered

How do I solve the transcendental equation to form a vector with the results?

This seems to be homework. You first need to create a function from your equation that you can solve for *|‘x’|* that is also a...

How do I solve the transcendental equation to form a vector with the results?

This seems to be homework. You first need to create a function from your equation that you can solve for *|‘x’|* that is also a...

5 days ago | 0

Answered

Rebinning values and for loops

Try this: framedist = randi(9, 1, 90); A = reshape(framedist(:), 30, []); secdist = sum(A) It reshapes *|‘framedi...

Rebinning values and for loops

Try this: framedist = randi(9, 1, 90); A = reshape(framedist(:), 30, []); secdist = sum(A) It reshapes *|‘framedi...

5 days ago | 0

| accepted