12,777 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

Passing a vector through a built in function?

Do element-wise multiplication and division: V=sqrt((2*W.*cosd(theta))./(CL*p6000)); ↑ ↑ S...

Passing a vector through a built in function?

Do element-wise multiplication and division: V=sqrt((2*W.*cosd(theta))./(CL*p6000)); ↑ ↑ S...

13 hours ago | 0

| accepted

Answered

How do I get the date out of a filename using regexp?

There are likely several ways to approach this. I would do it a bit differently: str = 'xxx_2014_06_03_00_00_01'; fdate = re...

How do I get the date out of a filename using regexp?

There are likely several ways to approach this. I would do it a bit differently: str = 'xxx_2014_06_03_00_00_01'; fdate = re...

17 hours ago | 0

| accepted

Answered

Name the first column in array2table

The code you posted produces an acceptable table object. I am not certain what you want. I am guessing here: coeff = rand(...

Name the first column in array2table

The code you posted produces an acceptable table object. I am not certain what you want. I am guessing here: coeff = rand(...

17 hours ago | 0

| accepted

Answered

I'm trying to define a simbolic variable like ¨ syms x ¨. I used to do it but now It doesn't work..

Run these lines from your Command Window or a script: restoredefaultpath rehash toolboxcache If doing that does not solve ...

I'm trying to define a simbolic variable like ¨ syms x ¨. I used to do it but now It doesn't work..

Run these lines from your Command Window or a script: restoredefaultpath rehash toolboxcache If doing that does not solve ...

18 hours ago | 0

Answered

Reduce data points from 200 to 108

I have no idea what your data are or what you want to do with them, other than reduce the number of them. Interpolating them ...

Reduce data points from 200 to 108

I have no idea what your data are or what you want to do with them, other than reduce the number of them. Interpolating them ...

19 hours ago | 0

| accepted

Answered

How to make 3D-line plots (Sine Wave)?

With three small changes to your code, it works: t = 0:0.01:5*pi; z = 0:pi/12:2*pi; phase = 0; ...

How to make 3D-line plots (Sine Wave)?

With three small changes to your code, it works: t = 0:0.01:5*pi; z = 0:pi/12:2*pi; phase = 0; ...

19 hours ago | 0

| accepted

Answered

'Character vector is not terminated properly' when I am trying to open a .fis file in MATLAB

You likely either forgot a closing single quotation mark (') or you inserted one in error. Without seeing your code, it is no...

'Character vector is not terminated properly' when I am trying to open a .fis file in MATLAB

You likely either forgot a closing single quotation mark (') or you inserted one in error. Without seeing your code, it is no...

21 hours ago | 0

| accepted

Answered

Identifying x value at y on an xy plot

A common problem interpolating y-values that are not unique is how to make them appropriate for interpolation. One way is to si...

Identifying x value at y on an xy plot

A common problem interpolating y-values that are not unique is how to make them appropriate for interpolation. One way is to si...

22 hours ago | 0

| accepted

Answered

Plots appear as giant blocks rather than actual waveforms

The waveforms are there. The problem is that they are very densely packed in those images, so they appear as blue blocks. Us...

Plots appear as giant blocks rather than actual waveforms

The waveforms are there. The problem is that they are very densely packed in those images, so they appear as blue blocks. Us...

1 day ago | 0

| accepted

Answered

Area between curve (numerical data with positive and negative values) and y = 0

I do not have a clear idea of what you want as the result. It is relatively straightforward to integrate the areas greater th...

Area between curve (numerical data with positive and negative values) and y = 0

I do not have a clear idea of what you want as the result. It is relatively straightforward to integrate the areas greater th...

1 day ago | 0

| accepted

Answered

Average of Wave from 10 waves in single graph

Try this: D = load('P_191005_000.mat'); ap = D.b; Ts = 1E-3; ...

Average of Wave from 10 waves in single graph

Try this: D = load('P_191005_000.mat'); ap = D.b; Ts = 1E-3; ...

1 day ago | 2

| accepted

Answered

How to take Average of many waves to single wave(want he averge of all waves to a single wave)

Used the islocalmin function to find the minima of the waveform, then use those indices to store the wave segments in a cell arr...

How to take Average of many waves to single wave(want he averge of all waves to a single wave)

Used the islocalmin function to find the minima of the waveform, then use those indices to store the wave segments in a cell arr...

1 day ago | 1

| accepted

Answered

give labels according to string

Try this: String = {'Abc\a1\L\XYZ1R08' 'Abc\a1\R\XYZ1R09' 'Abc\a1\R\XYZ1R10' 'Abc\b2\L\XYZ2L01' 'Abc\b2\R\XYZ2L02' 'A...

give labels according to string

Try this: String = {'Abc\a1\L\XYZ1R08' 'Abc\a1\R\XYZ1R09' 'Abc\a1\R\XYZ1R10' 'Abc\b2\L\XYZ2L01' 'Abc\b2\R\XYZ2L02' 'A...

1 day ago | 1

| accepted

Answered

Help, How to convert image to binary image ?

See if im2bw (R2015b and earlier) or imbinarize (R2016a and alter) will do what you want.

Help, How to convert image to binary image ?

See if im2bw (R2015b and earlier) or imbinarize (R2016a and alter) will do what you want.

2 days ago | 0

| accepted

Answered

find transfer function of input and output signals and then perform an FFT.

This should get you started: [D,S] = xlsread('Test_data_1.xlsx'); torg = D(:,1); ...

find transfer function of input and output signals and then perform an FFT.

This should get you started: [D,S] = xlsread('Test_data_1.xlsx'); torg = D(:,1); ...

2 days ago | 1

| accepted

Answered

Extract and code gender string as number using if loop

I do not udnerstand the reason strcmp or strncmp would not work with your structure data. We may have to see ‘tempfile.data.gen...

Extract and code gender string as number using if loop

I do not udnerstand the reason strcmp or strncmp would not work with your structure data. We may have to see ‘tempfile.data.gen...

2 days ago | 0

| accepted

Answered

Interpolation of scattered earthquake data

There are several options. First, see if the griddata function will do what you want. (The Mapping Toolbox may have more appli...

Interpolation of scattered earthquake data

There are several options. First, see if the griddata function will do what you want. (The Mapping Toolbox may have more appli...

2 days ago | 0

| accepted

Answered

SUM OF (-1^K)/FACTORIAL(K+1)

First, use element-wise operations: k = 1:6; v = (-1).^k./factorial(k+1) sv = sum(v) See Array vs. Matrix Operations for a ...

SUM OF (-1^K)/FACTORIAL(K+1)

First, use element-wise operations: k = 1:6; v = (-1).^k./factorial(k+1) sv = sum(v) See Array vs. Matrix Operations for a ...

3 days ago | 0

Answered

The magnitude in Bode plot differs from the mag values returned with: [mag,phase,wout] = bode(G,win)

The output magnitudes are not in decibels. If you instead use: mag_dB = 20*log10(mag) the result is: mag_dB = 27.7802...

The magnitude in Bode plot differs from the mag values returned with: [mag,phase,wout] = bode(G,win)

The output magnitudes are not in decibels. If you instead use: mag_dB = 20*log10(mag) the result is: mag_dB = 27.7802...

3 days ago | 0

| accepted

Answered

Format colorbar using engineering notation

Try this: engstr = @(x) [x(:).*10.^(-3*floor(log10(abs(x(:)))/3)) 3*floor(log10(abs(x(:)))/3)]; Q1 = logspace(-3, 3, 7); ...

Format colorbar using engineering notation

Try this: engstr = @(x) [x(:).*10.^(-3*floor(log10(abs(x(:)))/3)) 3*floor(log10(abs(x(:)))/3)]; Q1 = logspace(-3, 3, 7); ...

3 days ago | 0

| accepted

Answered

Failure in initial objective function evaluation. FMINUNC cannot continue.

Unless it is already in a function file, it needs to be an anonymous function: f = @(x) x(2)^2*x(9)^2 + x(2)^2*x(9) + x(2)^3*x...

Failure in initial objective function evaluation. FMINUNC cannot continue.

Unless it is already in a function file, it needs to be an anonymous function: f = @(x) x(2)^2*x(9)^2 + x(2)^2*x(9) + x(2)^3*x...

3 days ago | 1

| accepted

Answered

Read several large csv and store as separate variables

Perhaps saving it in a cell array would work: file{i}=readmatrix(filename); Note the curly brackets {} denoting cell-array i...

Read several large csv and store as separate variables

Perhaps saving it in a cell array would work: file{i}=readmatrix(filename); Note the curly brackets {} denoting cell-array i...

4 days ago | 0

Answered

How to quickly find the maximum group of same rows in a matrix?

Try this: A = [0 1 0 1 0 0 0 0; 1 0 0 0 1 0 0 0; 1 0 0 0 ...

How to quickly find the maximum group of same rows in a matrix?

Try this: A = [0 1 0 1 0 0 0 0; 1 0 0 0 1 0 0 0; 1 0 0 0 ...

4 days ago | 0

| accepted

Answered

Display Markers At Specific Data Points

The MarkerIndices name-value pair is relatively new. If you do not have it, it is straightforward to do that with a second plo...

Display Markers At Specific Data Points

The MarkerIndices name-value pair is relatively new. If you do not have it, it is straightforward to do that with a second plo...

4 days ago | 1

| accepted

Answered

Units for Magnitude after Fast Fourier Transform (FFT) is done

The magnitude units are the same as the time-domain amplitude units, unless you transform them in some way (such as squaring to ...

Units for Magnitude after Fast Fourier Transform (FFT) is done

The magnitude units are the same as the time-domain amplitude units, unless you transform them in some way (such as squaring to ...

4 days ago | 0

Answered

How to fill a vector with just 2 elements -1 and 1, as a pseudorandom sequence?

Try this: N = 10; xpnt = randi(2, 1, N); X = (-1).^xpnt; producing (in this run): X = -1 1 1 1 -1 ...

How to fill a vector with just 2 elements -1 and 1, as a pseudorandom sequence?

Try this: N = 10; xpnt = randi(2, 1, N); X = (-1).^xpnt; producing (in this run): X = -1 1 1 1 -1 ...

4 days ago | 1

| accepted

Answered

design filter , Hello everyone, I'm trying to run a script I've written that deals with signal modulation and frequency filtering. unfortunately, the software is crashing at runtime while its deal with the "bode", what can i do?

The bode function is part of the Control System Toolbox (and friends). It takes a system object as an argument. Also, multiply...

design filter , Hello everyone, I'm trying to run a script I've written that deals with signal modulation and frequency filtering. unfortunately, the software is crashing at runtime while its deal with the "bode", what can i do?

The bode function is part of the Control System Toolbox (and friends). It takes a system object as an argument. Also, multiply...

4 days ago | 0

| accepted

Answered

How to rearrange the output variables for matlabFunction()?

I can’t run the code you posted, since it generates significant errors about matrix size multiplication. However, a simple ex...

How to rearrange the output variables for matlabFunction()?

I can’t run the code you posted, since it generates significant errors about matrix size multiplication. However, a simple ex...

4 days ago | 1

| accepted

Answered

solve an equation using solve() produces an array instead of a unique value

The result is correct. There are three roots. Plot it to see the result: syms h d = 32*h + 200*(32*h - 8)*((4*h - 1)^2 -...

solve an equation using solve() produces an array instead of a unique value

The result is correct. There are three roots. Plot it to see the result: syms h d = 32*h + 200*(32*h - 8)*((4*h - 1)^2 -...

5 days ago | 0

| accepted

Answered

Error while solving a coupled system of ODE

Your ‘DM_bacteria’ function must return a column vector output. This worked when I ran it just now: function [dxdt] = DM_ba...

Error while solving a coupled system of ODE

Your ‘DM_bacteria’ function must return a column vector output. This worked when I ran it just now: function [dxdt] = DM_ba...

5 days ago | 1