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

Error in following MATLAB codes

This is the problem: y = t-1; x3(t) = x3(y) - (x2(t)/E_batt_inst); So when ‘t=1’, ‘y=0’ and that throws the ...

Error in following MATLAB codes

This is the problem: y = t-1; x3(t) = x3(y) - (x2(t)/E_batt_inst); So when ‘t=1’, ‘y=0’ and that throws the ...

10 hours ago | 0

Answered

Plot 2D matrix on 2D graph

Plot it against a 1000-element row vector: figure plot((1:1000), YourMatrix)

Plot 2D matrix on 2D graph

Plot it against a 1000-element row vector: figure plot((1:1000), YourMatrix)

15 hours ago | 0

Answered

unexpected error when trying to open MATLAB

You should click on the Contact Us link in the upper right corner of this page and request Technical Support. If that page re...

unexpected error when trying to open MATLAB

You should click on the Contact Us link in the upper right corner of this page and request Technical Support. If that page re...

15 hours ago | 0

Answered

Duplicating rows in a matrix

Try this: M = [0 1 0 0 0 2 0 0]; M2 = repmat(M, 1, 2); M2 = reshape(M2', [], 4)' producing: M2 = 0 1 ...

Duplicating rows in a matrix

Try this: M = [0 1 0 0 0 2 0 0]; M2 = repmat(M, 1, 2); M2 = reshape(M2', [], 4)' producing: M2 = 0 1 ...

15 hours ago | 0

| accepted

Answered

In an assignment A(:) = B, the number of elements in A and B must be the same.

My version of the Symbolic Math Toolbox doesn’t like quoted strings, so I had to change your code a bit. Try this: syms p x...

In an assignment A(:) = B, the number of elements in A and B must be the same.

My version of the Symbolic Math Toolbox doesn’t like quoted strings, so I had to change your code a bit. Try this: syms p x...

20 hours ago | 0

| accepted

Answered

kNN Classification on SSVEP response

In my experience, to use knnsearch (link) with data, the idea is to begin with samples that have known classes, then compare the...

kNN Classification on SSVEP response

In my experience, to use knnsearch (link) with data, the idea is to begin with samples that have known classes, then compare the...

1 day ago | 0

| accepted

Answered

Why won't this compute?

I’ve never seen that syntax in any programming language I’ve ever encountered. If I parse it as: strange_expression = (10/1...

Why won't this compute?

I’ve never seen that syntax in any programming language I’ve ever encountered. If I parse it as: strange_expression = (10/1...

1 day ago | 1

| accepted

Answered

Indexing into an Array in a For Loop is Off by 1?

Absolutely guessing here. Perhaps it is because your ‘x’ value begins at 0? Array indices in MATLAB are integers greater tha...

Indexing into an Array in a For Loop is Off by 1?

Absolutely guessing here. Perhaps it is because your ‘x’ value begins at 0? Array indices in MATLAB are integers greater tha...

1 day ago | 0

| accepted

Answered

Add a variable within single quotes

I have no idea what your ‘filename’ array is. If it is the name without the ‘.csv’ extension, something like this may work: ...

Add a variable within single quotes

I have no idea what your ‘filename’ array is. If it is the name without the ‘.csv’ extension, something like this may work: ...

1 day ago | 0

| accepted

Answered

how to use helperGaitPlot?

Type these lines in a script or your Command Window: doc helperGaitPlot doc helperGaitImport type helperGaitPlot type hel...

how to use helperGaitPlot?

Type these lines in a script or your Command Window: doc helperGaitPlot doc helperGaitImport type helperGaitPlot type hel...

2 days ago | 0

Answered

How can plot multiple same amplitude signals along with same y axis ?

Try something like this using the bsxfun (link) function: x = linspace(0, 2*pi); % Independent Va...

How can plot multiple same amplitude signals along with same y axis ?

Try something like this using the bsxfun (link) function: x = linspace(0, 2*pi); % Independent Va...

2 days ago | 1

Answered

how to automatic segmentation signal

The findchangepts (link) function (introduced in R2016a) is perfect for this: D = load('matlab.mat'); data = D.data; Fs = D....

how to automatic segmentation signal

The findchangepts (link) function (introduced in R2016a) is perfect for this: D = load('matlab.mat'); data = D.data; Fs = D....

2 days ago | 1

| accepted

Answered

Definite integration in matlab with the limits changing ?

Try this: f = @(u) (-1.99)./(1.99-2*exp(-0.01*u)-1.98*exp(-2*u)); % u is a dummy variable z = 0 : 5; for k1 = 1:numel(z) ...

Definite integration in matlab with the limits changing ?

Try this: f = @(u) (-1.99)./(1.99-2*exp(-0.01*u)-1.98*exp(-2*u)); % u is a dummy variable z = 0 : 5; for k1 = 1:numel(z) ...

2 days ago | 0

| accepted

Answered

How can one modify the displayed units in the Bode plot from "Magnitude(dB)" to "Magnitude(dBV)" or "Magnitude(dB-ohms)" etc.

The bode function (and other Control System Toolbox plotting functions) are essentially impossible to modify. Instead use thi...

How can one modify the displayed units in the Bode plot from "Magnitude(dB)" to "Magnitude(dBV)" or "Magnitude(dB-ohms)" etc.

The bode function (and other Control System Toolbox plotting functions) are essentially impossible to modify. Instead use thi...

2 days ago | 0

Answered

Not Enough Input Arguments

That should return the minimum of the first column of ‘XY’, and runs for me without error when I supply a random matrix for ‘XY’...

Not Enough Input Arguments

That should return the minimum of the first column of ‘XY’, and runs for me without error when I supply a random matrix for ‘XY’...

3 days ago | 0

Answered

High Pass Butterworth Filter increases unwanted frequencies using Filtfilt

First, if you want to eliminate the D-C value, simply subtract the mean of your signal from your signal. You do not need to fil...

High Pass Butterworth Filter increases unwanted frequencies using Filtfilt

First, if you want to eliminate the D-C value, simply subtract the mean of your signal from your signal. You do not need to fil...

3 days ago | 1

| accepted

Answered

Brace indexing is not supported for variables of this type. Error in Untitled3 (line 7) myfile1 = myfile1{1};

The imread function returns a numeric array, not a cell. See the documentation section on A (link) in the Output Arguments sect...

Brace indexing is not supported for variables of this type. Error in Untitled3 (line 7) myfile1 = myfile1{1};

The imread function returns a numeric array, not a cell. See the documentation section on A (link) in the Output Arguments sect...

3 days ago | 0

| accepted

Answered

Probability - Linear Regression

I don’t know if you have the Optimization Toolbox or the Statistics and Machine Learning Toolbox, both of which have nonlinear r...

Probability - Linear Regression

I don’t know if you have the Optimization Toolbox or the Statistics and Machine Learning Toolbox, both of which have nonlinear r...

3 days ago | 1

| accepted

Answered

How to plot years on x axis

There are several ways to approach that, including datetime (link) arrays. A simple solution is: M = [ 1975 -66.0577 ...

How to plot years on x axis

There are several ways to approach that, including datetime (link) arrays. A simple solution is: M = [ 1975 -66.0577 ...

3 days ago | 0

| accepted

Answered

how to draw a 2d stacked plot

I can barely see any variation, even when I enlarge the image. One option is simply to amplify them, perhaps by 100, and note...

how to draw a 2d stacked plot

I can barely see any variation, even when I enlarge the image. One option is simply to amplify them, perhaps by 100, and note...

4 days ago | 0

| accepted

Answered

Legend of graph doesn't match plot color and style

You can plot an independent variable aganst a dependentent variable constant, however you will end up with the problem you are ...

Legend of graph doesn't match plot color and style

You can plot an independent variable aganst a dependentent variable constant, however you will end up with the problem you are ...

4 days ago | 1

| accepted

Answered

How to modify all the datas in a txt files?

Try this: D = load('output.txt') D = D+1; P = 'Your_Path'; save(fullfile(P,'output1.txt'), 'D', '-ascii'); D1 = load('outp...

How to modify all the datas in a txt files?

Try this: D = load('output.txt') D = D+1; P = 'Your_Path'; save(fullfile(P,'output1.txt'), 'D', '-ascii'); D1 = load('outp...

4 days ago | 0

| accepted

Answered

Error in histogram plot including datetime

You already appear to have the data you want to plot, so histogram may not be the correct choice. Try this instead: figure ...

Error in histogram plot including datetime

You already appear to have the data you want to plot, so histogram may not be the correct choice. Try this instead: figure ...

4 days ago | 0

Answered

Error in using Load

That example should be at: web(fullfile(docroot, 'signal/examples/detecting-outbreaks-and-significant-changes-in-signals.html'...

Error in using Load

That example should be at: web(fullfile(docroot, 'signal/examples/detecting-outbreaks-and-significant-changes-in-signals.html'...

4 days ago | 0

| accepted

Answered

How can I plot a point which is product of two functions in time domain with changing parameter?

Try this: l = 1; %length u1 = 1; %speed u2 = 0; %turning speed(movement=[u1;u2]=[1;0] %inits : x0 = 0; %rear axle x p...

How can I plot a point which is product of two functions in time domain with changing parameter?

Try this: l = 1; %length u1 = 1; %speed u2 = 0; %turning speed(movement=[u1;u2]=[1;0] %inits : x0 = 0; %rear axle x p...

5 days ago | 1

| accepted

Answered

How to create overlapping blocks using a matrix rows ?

Try this: A=[0 1 0 0 1 1 0 1 0 1 0 1 0]; S = hankel(A, [0 1 1 1]); S = S(1:10,:); B = mat2cell(S, ones(1,size(S,1)), size(S...

How to create overlapping blocks using a matrix rows ?

Try this: A=[0 1 0 0 1 1 0 1 0 1 0 1 0]; S = hankel(A, [0 1 1 1]); S = S(1:10,:); B = mat2cell(S, ones(1,size(S,1)), size(S...

5 days ago | 1

| accepted

Answered

How can I draw a line from center of multiple circles that will intersect all the circles?

Try this: t = linspace(0, 2*pi); r = [1, 2, 3]; xc = 0.5; yc = 0.1; xcir = (r(:)*cos(t))' + xc; ycir = (r(:)*sin(t))' + y...

How can I draw a line from center of multiple circles that will intersect all the circles?

Try this: t = linspace(0, 2*pi); r = [1, 2, 3]; xc = 0.5; yc = 0.1; xcir = (r(:)*cos(t))' + xc; ycir = (r(:)*sin(t))' + y...

5 days ago | 1

| accepted

Answered

how to calculate the norm of each elements of a matrix?

I am not certain what you intend with the term ‘norm’. See if the abs (link) function will do what you want.

how to calculate the norm of each elements of a matrix?

I am not certain what you intend with the term ‘norm’. See if the abs (link) function will do what you want.

5 days ago | 0

| accepted

Answered

Differential System Of Equations

No mystery at all. Add these three assignments after your dsolve call: xSolvpa = vpa(xSol) ySolvpa = vpa(ySol) zSolvpa = ...

Differential System Of Equations

No mystery at all. Add these three assignments after your dsolve call: xSolvpa = vpa(xSol) ySolvpa = vpa(ySol) zSolvpa = ...

5 days ago | 0

| accepted