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

Is there a way to set the xticklabel text alignment

The example in Specify x-Axis Tick Values and Labels appear to be centre-aligned.

Is there a way to set the xticklabel text alignment

The example in Specify x-Axis Tick Values and Labels appear to be centre-aligned.

2 hours ago | 0

Answered

If elseif else statement inside a loop

Perhaps: for k = 1:5 YourGrade= input('Enter your number grade:') if YourGrade >= 90; disp('Your grade is a...

If elseif else statement inside a loop

Perhaps: for k = 1:5 YourGrade= input('Enter your number grade:') if YourGrade >= 90; disp('Your grade is a...

4 hours ago | 0

Answered

NaN issue when calculating for a mean value

The NaN result is due to one or more elements of the vector you are taking the mean of being (0/0) or (Inf/Inf), since they eval...

NaN issue when calculating for a mean value

The NaN result is due to one or more elements of the vector you are taking the mean of being (0/0) or (Inf/Inf), since they eval...

7 hours ago | 0

Answered

Least squares regression of a quadratic without bx term.

Try this: DM = [x(:).^2 ones(size(x(:)))]; % Design Matrix B = DM \ y(:); ...

Least squares regression of a quadratic without bx term.

Try this: DM = [x(:).^2 ones(size(x(:)))]; % Design Matrix B = DM \ y(:); ...

10 hours ago | 0

Answered

FFT analysis of multiple signals with the same response length

The fft function operates column-wise (unless the argument is a vector or you tell it otherwise), so this is all that is necessa...

FFT analysis of multiple signals with the same response length

The fft function operates column-wise (unless the argument is a vector or you tell it otherwise), so this is all that is necessa...

11 hours ago | 0

Answered

solving differential equation and assigning value to symfun

Try this: t_val = vpasolve(ySol==1,t) % Symbolic Solution

solving differential equation and assigning value to symfun

Try this: t_val = vpasolve(ySol==1,t) % Symbolic Solution

11 hours ago | 0

Answered

Solving for a variable in equation

Use a root-finding function (I chose fzero here), then take the known variable values, create an anonymous function from the exp...

Solving for a variable in equation

Use a root-finding function (I chose fzero here), then take the known variable values, create an anonymous function from the exp...

22 hours ago | 0

| accepted

Answered

How to find data values that falls on line connecting loglog plot in matlab

To get a smooth interpolation, it is necessary to do two transformations on it. First, interpolate log(y), and then take the ex...

How to find data values that falls on line connecting loglog plot in matlab

To get a smooth interpolation, it is necessary to do two transformations on it. First, interpolate log(y), and then take the ex...

22 hours ago | 0

| accepted

Answered

Magnitude, row and column in a Matrix

Try this: A = [87.97 87.97 17.97 95.22 87.96 91.26 75.50 75.50 75.50 78.13 64.89 78.90]; ...

Magnitude, row and column in a Matrix

Try this: A = [87.97 87.97 17.97 95.22 87.96 91.26 75.50 75.50 75.50 78.13 64.89 78.90]; ...

1 day ago | 0

| accepted

Answered

How to solve non linear system of ODE

If you are fitting the differential equations to data, see Monod kinetics and curve fitting and Parameter Estimation for a Syste...

How to solve non linear system of ODE

If you are fitting the differential equations to data, see Monod kinetics and curve fitting and Parameter Estimation for a Syste...

1 day ago | 0

Answered

How do I obtain the derivatives after interp2 with the 'spline' option?

To get a numerical derivative, use the gradient function. With a matrix input, request two outputs. See Contour Plot of Vect...

How do I obtain the derivatives after interp2 with the 'spline' option?

To get a numerical derivative, use the gradient function. With a matrix input, request two outputs. See Contour Plot of Vect...

1 day ago | 0

| accepted

Answered

How to plot a two variable function?

Apparently ‘x’ is a vector. That means that ‘z’ produces only two values. You could plot it as: figure plot(z, 'p') howe...

How to plot a two variable function?

Apparently ‘x’ is a vector. That means that ‘z’ produces only two values. You could plot it as: figure plot(z, 'p') howe...

1 day ago | 0

Answered

Easiest way to skip a few lines and then read data from this text file ( x and y) to draw a plot.

The easiest way I can think of is to use the dlmread function: filename = '6in_nomass_5.txt'; Data = dlmread(filename, '\t', ...

Easiest way to skip a few lines and then read data from this text file ( x and y) to draw a plot.

The easiest way I can think of is to use the dlmread function: filename = '6in_nomass_5.txt'; Data = dlmread(filename, '\t', ...

1 day ago | 0

Answered

X,Y data of irregular grid, scatter plot with Z data

It is not obvious to me what you want. You already appear to have tried reshape, although I have no idea what the arguments ...

X,Y data of irregular grid, scatter plot with Z data

It is not obvious to me what you want. You already appear to have tried reshape, although I have no idea what the arguments ...

1 day ago | 0

| accepted

Answered

How do I synchronize stress-strain data?

If you want both of them to have the same sampling frequency, use the resample function on one of them. That will make the proc...

How do I synchronize stress-strain data?

If you want both of them to have the same sampling frequency, use the resample function on one of them. That will make the proc...

1 day ago | 0

Answered

How to find the best parameters to fit damped oscillations curves

See: How to filter noise from time-frequency data and find natural frequency of a cantilever? Specifically: D = load('Lo...

How to find the best parameters to fit damped oscillations curves

See: How to filter noise from time-frequency data and find natural frequency of a cantilever? Specifically: D = load('Lo...

1 day ago | 1

| accepted

Answered

fminsearch for fitting a function to experimental data

There are several errors in the posted code, as Walter noted, mostly involving implicit multiplication, that MATLAB does not rec...

fminsearch for fitting a function to experimental data

There are several errors in the posted code, as Walter noted, mostly involving implicit multiplication, that MATLAB does not rec...

1 day ago | 0

Answered

Interpolate Data and find the matching x-Value

Try this: data=[1 2, 2 3, 3 3, 4 5, 7 9]; xval = @(yval) fsolve(@(x) interp1(data(:,1...

Interpolate Data and find the matching x-Value

Try this: data=[1 2, 2 3, 3 3, 4 5, 7 9]; xval = @(yval) fsolve(@(x) interp1(data(:,1...

1 day ago | 0

| accepted

Answered

Why ('t=(2x+1)/(2x-2)','x') is unsolvable?

Correct syntax: syms t x solve(t==(2*x+1)/(2*x-2),x) producing: ans = (2*t + 1)/(2*t - 2)

Why ('t=(2x+1)/(2x-2)','x') is unsolvable?

Correct syntax: syms t x solve(t==(2*x+1)/(2*x-2),x) producing: ans = (2*t + 1)/(2*t - 2)

2 days ago | 0

| accepted

Answered

Wrong FFT for an audio file

The plot is correct. You are not considering the exponential multiplication at the right end of the frequency axis. This mak...

Wrong FFT for an audio file

The plot is correct. You are not considering the exponential multiplication at the right end of the frequency axis. This mak...

2 days ago | 0

| accepted

Answered

How to conditionally change values in a table

Try this: val1 = {1, 2, 3, 4, 5, 6, 7, 8, 9}.'; val2 = {1, 3, 2, 1, 1, 4, 1, 1, 3}.'; t1 = table(val1, val2); lidx = ([t1.v...

How to conditionally change values in a table

Try this: val1 = {1, 2, 3, 4, 5, 6, 7, 8, 9}.'; val2 = {1, 3, 2, 1, 1, 4, 1, 1, 3}.'; t1 = table(val1, val2); lidx = ([t1.v...

3 days ago | 0

| accepted

Answered

Seperate yyyymm to mm-yyyy

Try this: ym = [201910 201911 201912 202001]; % Numeric (?) yms = compose('%6d',y...

Seperate yyyymm to mm-yyyy

Try this: ym = [201910 201911 201912 202001]; % Numeric (?) yms = compose('%6d',y...

3 days ago | 0

Answered

How to compare data

If they both have the same distribution (regardless of what that distribution is),and you are comparing two samples, the ranksum...

How to compare data

If they both have the same distribution (regardless of what that distribution is),and you are comparing two samples, the ranksum...

3 days ago | 1

| accepted

Answered

How to plot power law velocity profile

It plots the values correctly. Note that since ‘d’ and ‘r’ are the same, this part of the expression: (d.^((n+1)/n)-r.^((n+...

How to plot power law velocity profile

It plots the values correctly. Note that since ‘d’ and ‘r’ are the same, this part of the expression: (d.^((n+1)/n)-r.^((n+...

3 days ago | 0

Answered

Zeros on [b,a] output of butter filter

The filter is unstable. This can easily be remedied by converting to zero-pole-gain realization, and then second-order section ...

Zeros on [b,a] output of butter filter

The filter is unstable. This can easily be remedied by converting to zero-pole-gain realization, and then second-order section ...

3 days ago | 0

| accepted

Answered

call dsolve() equation as function for reference.

Try this: syms A(z) B0 = 400; N = 1000; beta = 0.51; gamma = 0.5; Tend =100; cond = A(0) == B0; eqns = diff(A,z) == be...

call dsolve() equation as function for reference.

Try this: syms A(z) B0 = 400; N = 1000; beta = 0.51; gamma = 0.5; Tend =100; cond = A(0) == B0; eqns = diff(A,z) == be...

3 days ago | 0

| accepted

Answered

Get a three column matrix from meshgrid data

Add one line: x=linspace(0.1,0.3,3); y=linspace(1,3,3); [x1,y1] = meshgrid(x,y); z=x1.*y1; C = [x1(:), y1(:), z(:)] to p...

Get a three column matrix from meshgrid data

Add one line: x=linspace(0.1,0.3,3); y=linspace(1,3,3); [x1,y1] = meshgrid(x,y); z=x1.*y1; C = [x1(:), y1(:), z(:)] to p...

3 days ago | 0

| accepted

Answered

Output argument "XXX" (and maybe others) not assigned during call to "function".

First — Please do not use global variables! They create more problems than they aolve, and can make code very difficult to debu...

Output argument "XXX" (and maybe others) not assigned during call to "function".

First — Please do not use global variables! They create more problems than they aolve, and can make code very difficult to debu...

4 days ago | 0

Answered

Non-linear Multivariate regression using genetic algorithm

One (very basic) approach: xd = rand(10,1); ...

Non-linear Multivariate regression using genetic algorithm

One (very basic) approach: xd = rand(10,1); ...

4 days ago | 0

| accepted

Answered

Change axis colour matlab

Try this: x = linspace(20, 50, 29); y = sin((x-20)/30 * 2 * pi); figure plot(x, y) xt = xticks(gca); xt2 = compose('%.0...

Change axis colour matlab

Try this: x = linspace(20, 50, 29); y = sin((x-20)/30 * 2 * pi); figure plot(x, y) xt = xticks(gca); xt2 = compose('%.0...

4 days ago | 1