11,812 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

Symbolic coding calculations problem.

First ‘relevant’ is relative. You left out your syms call, and perhaps others, making it difficult to work with. To simplify...

Symbolic coding calculations problem.

First ‘relevant’ is relative. You left out your syms call, and perhaps others, making it difficult to work with. To simplify...

15 hours ago | 0

| accepted

Answered

What does "axes( __ )" mean on the Axes help page?

That construction returns the handle of the axes object. The handle allows you to change the accessible properties of the objec...

What does "axes( __ )" mean on the Axes help page?

That construction returns the handle of the axes object. The handle allows you to change the accessible properties of the objec...

15 hours ago | 0

| accepted

Answered

How to plot 3 variables (3rd variable on the colorbar)?

That looks like a surf plot, using view(0,90) to create a 2D plot from it. How you plot it depends on how your data are org...

How to plot 3 variables (3rd variable on the colorbar)?

That looks like a surf plot, using view(0,90) to create a 2D plot from it. How you plot it depends on how your data are org...

15 hours ago | 0

| accepted

Answered

How to determine maximum length in the x and y direction respectively

I am not certain what you are asking. If you want line connecting the maximum and minimum x-coordinates and another connecting ...

How to determine maximum length in the x and y direction respectively

I am not certain what you are asking. If you want line connecting the maximum and minimum x-coordinates and another connecting ...

16 hours ago | 0

Answered

Can i get arc length out of polyval?

Try this (lightly edited version of your code): dfdx = @(f,x) (f(x + 1E-8) - f(x)) ./ 1E-8; % Simple Numeric Derivativ...

Can i get arc length out of polyval?

Try this (lightly edited version of your code): dfdx = @(f,x) (f(x + 1E-8) - f(x)) ./ 1E-8; % Simple Numeric Derivativ...

20 hours ago | 0

| accepted

Answered

How to find a limit without syms and limit function

Crude but effective (for this function, may not be universally applicable): fcn = @(x) (x.^3 - 1) ./ (x - 1); x = 1; lm = fc...

How to find a limit without syms and limit function

Crude but effective (for this function, may not be universally applicable): fcn = @(x) (x.^3 - 1) ./ (x - 1); x = 1; lm = fc...

22 hours ago | 0

| accepted

Answered

Find optimized solution of linear system of equations

Try this: syms kd kp ki Eq1 = 0.1*kd +0.49 == 18; Eq2 = 0.04*kd +0.1*kp +21.6 == 121; Eq3 = 0.04*kd +0.1*ki +0.98 == 4...

Find optimized solution of linear system of equations

Try this: syms kd kp ki Eq1 = 0.1*kd +0.49 == 18; Eq2 = 0.04*kd +0.1*kp +21.6 == 121; Eq3 = 0.04*kd +0.1*ki +0.98 == 4...

1 day ago | 0

Answered

Estimating multiple parameters from a regression

That is a simple linear regression. Try this: B = [x1 x2 u] \ fy; a = B(1) b = B(2) c = B(3)

Estimating multiple parameters from a regression

That is a simple linear regression. Try this: B = [x1 x2 u] \ fy; a = B(1) b = B(2) c = B(3)

1 day ago | 0

| accepted

Answered

How to find centroid or center of a 3D irregular shape

The centroid is defined as the arithmetic mean of the points, so just do that in each (x,y,z) dimension.

How to find centroid or center of a 3D irregular shape

The centroid is defined as the arithmetic mean of the points, so just do that in each (x,y,z) dimension.

1 day ago | 0

| accepted

Answered

I want to find code time delay

I have no idea what you are asking. If you want to find out how long it takes your code to run, use the tic (link) and toc fu...

I want to find code time delay

I have no idea what you are asking. If you want to find out how long it takes your code to run, use the tic (link) and toc fu...

2 days ago | 0

Answered

How can I symbolically solve this system of equations?

Try this: syms B1 B2 g m1 m2 K1 K2 P v1(t) v2(t) x1(t) x2(t) x10 x20 v10 v20 Eq1 = diff(x1) == v1; Eq2 = diff(v1) == (1/m1)...

How can I symbolically solve this system of equations?

Try this: syms B1 B2 g m1 m2 K1 K2 P v1(t) v2(t) x1(t) x2(t) x10 x20 v10 v20 Eq1 = diff(x1) == v1; Eq2 = diff(v1) == (1/m1)...

2 days ago | 0

Answered

Plotting multiple separate lines

Plot them as column vectors, not row vectors. Try this: A = [x1(:) y1(:)]; B = [x2(:) y2(:)]; I am not certain what result...

Plotting multiple separate lines

Plot them as column vectors, not row vectors. Try this: A = [x1(:) y1(:)]; B = [x2(:) y2(:)]; I am not certain what result...

2 days ago | 0

| accepted

Answered

Output argument "Yeq" (and maybe others) not assigned during call Error Message

The easiest way to avoid that error is to assign all the outputs as NaN initially. The code will then replace them as necessary...

Output argument "Yeq" (and maybe others) not assigned during call Error Message

The easiest way to avoid that error is to assign all the outputs as NaN initially. The code will then replace them as necessary...

2 days ago | 1

| accepted

Answered

How to create a manhattan function?

Considering that (from the mandist documentation): ‘The Manhattan distance D between two vectors X and Y is D = sum(abs(x-y))...

How to create a manhattan function?

Considering that (from the mandist documentation): ‘The Manhattan distance D between two vectors X and Y is D = sum(abs(x-y))...

2 days ago | 0

Answered

Not enough input arguments error in ode23?

Most of what you are doing appears to be correct (I removed the clc and close calls): tspan=[1 4]; IC=[1;1;-1]; [t,y]=ode23(...

Not enough input arguments error in ode23?

Most of what you are doing appears to be correct (I removed the clc and close calls): tspan=[1 4]; IC=[1;1;-1]; [t,y]=ode23(...

3 days ago | 0

Answered

How to partial derive a matrix with multiple variables

If your matrix is symbolic, see if the jacobian (link) function will do what you want. The gradient (link) function is also an ...

How to partial derive a matrix with multiple variables

If your matrix is symbolic, see if the jacobian (link) function will do what you want. The gradient (link) function is also an ...

3 days ago | 0

Answered

How to iterate xa from 0 to 1 with steps of 0.05 in the function r=F*(k*C*(1-xa))/(1+K*C*(1-xa)). All variables are known except for r.

Everything except ‘x’ are scalars, so you can do this using a vectorization approach without the loop: F=0.11574; k_kin=1.3*10...

How to iterate xa from 0 to 1 with steps of 0.05 in the function r=F*(k*C*(1-xa))/(1+K*C*(1-xa)). All variables are known except for r.

Everything except ‘x’ are scalars, so you can do this using a vectorization approach without the loop: F=0.11574; k_kin=1.3*10...

3 days ago | 1

| accepted

Answered

How do i detect/describe a curvature from a data-set of coordinates

The polyfit function will not give you the centre and radius of your arc. This will: t = linspace(-pi/4, pi/4, 10); ...

How do i detect/describe a curvature from a data-set of coordinates

The polyfit function will not give you the centre and radius of your arc. This will: t = linspace(-pi/4, pi/4, 10); ...

3 days ago | 0

| accepted

Answered

Retrieving a random element from each row in a matrix

It is likely easier to use the sub2ind funciton to create linear indices into ‘R’ from a defined list of random column subscript...

Retrieving a random element from each row in a matrix

It is likely easier to use the sub2ind funciton to create linear indices into ‘R’ from a defined list of random column subscript...

3 days ago | 0

| accepted

Answered

for plot using 'yyaxis left' and 'yyaxis right' how to add separate legends for the two y axes

The legend is for all the data in the plot (or as many as you want to incllude in the legend call). The y-axis labels are diffe...

for plot using 'yyaxis left' and 'yyaxis right' how to add separate legends for the two y axes

The legend is for all the data in the plot (or as many as you want to incllude in the legend call). The y-axis labels are diffe...

3 days ago | 0

Answered

how to calculate absolute value for a tf-object for a certain frequency

Thje evalfr (link) function is likely what you want. It requires a complex radian frequency for the frequency argument, so fo...

how to calculate absolute value for a tf-object for a certain frequency

Thje evalfr (link) function is likely what you want. It requires a complex radian frequency for the frequency argument, so fo...

3 days ago | 0

Answered

How do I only get vectors out of the butter function?

Your filter design has other problems. Your actual sampling frequency is: Fs = 1/mean(diff(t)); or 10, and the Nyquist frequ...

How do I only get vectors out of the butter function?

Your filter design has other problems. Your actual sampling frequency is: Fs = 1/mean(diff(t)); or 10, and the Nyquist frequ...

3 days ago | 0

Answered

Joining every eight columns in a matrix

Here are a couple approaches: A = [1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8; randi(9,1,16); randi(9,1,16)]; % Augmented S = spr...

Joining every eight columns in a matrix

Here are a couple approaches: A = [1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8; randi(9,1,16); randi(9,1,16)]; % Augmented S = spr...

4 days ago | 0

Answered

How can I find a vector in a matrix without using cycles?

Try this: A = [1 2 3 4 5 3 3 1 6 4 4 2]; B = [4 6]; Lidx = ism...

How can I find a vector in a matrix without using cycles?

Try this: A = [1 2 3 4 5 3 3 1 6 4 4 2]; B = [4 6]; Lidx = ism...

4 days ago | 0

| accepted

Answered

Plotting trajectories of a system of equations.

First, use the matlabFunction (link) function to create anonymous functions (or function files) from your symbolic expressions. ...

Plotting trajectories of a system of equations.

First, use the matlabFunction (link) function to create anonymous functions (or function files) from your symbolic expressions. ...

4 days ago | 0

Answered

Hi, how can i extract the angle from (x,y) coordinates in degrees.

Your best option is likely the atan2d (link) function.

Hi, how can i extract the angle from (x,y) coordinates in degrees.

Your best option is likely the atan2d (link) function.

4 days ago | 0

Answered

Index Exceeds number of array elements (1)

I suspect your initial conditions vector in your ode solver call only has one element. It should be a 5-element vector. You ...

Index Exceeds number of array elements (1)

I suspect your initial conditions vector in your ode solver call only has one element. It should be a 5-element vector. You ...

4 days ago | 0

| accepted

Answered

How to apply a diff to histogram object?

I have no idea what you wwant. Try this: dH = diff(H.BinCounts); To se all the available fields, do this: histogramField...

How to apply a diff to histogram object?

I have no idea what you wwant. Try this: dH = diff(H.BinCounts); To se all the available fields, do this: histogramField...

5 days ago | 0

| accepted

Answered

exponential with fuction integrate

You need to remove ’exp’ and ‘j’ from your syms call: syms t k w T You want to use the function exp, and the imaginary operat...

exponential with fuction integrate

You need to remove ’exp’ and ‘j’ from your syms call: syms t k w T You want to use the function exp, and the imaginary operat...

5 days ago | 0

| accepted

Answered

subtracting a number from string

One approach: str = 'subject1_EO'; nrc = regexp(str, '\d+', 'match') nr = str2double(nrc{:}) producing: nrc = 1×1 cell...

subtracting a number from string

One approach: str = 'subject1_EO'; nrc = regexp(str, '\d+', 'match') nr = str2double(nrc{:}) producing: nrc = 1×1 cell...

5 days ago | 1