10,888 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 do I get rid of lines connecting error bars?

Specify a marker only in your errorbar call: errorbar(valuesfrex,errex,'.');

How do I get rid of lines connecting error bars?

Specify a marker only in your errorbar call: errorbar(valuesfrex,errex,'.');

7 hours ago | 0

Answered

Solving a second order differential equation with matlab.

Try this: syms omega x(t) y(t) z t Dy = diff(y); D2y = diff(Dy); Eqn = y == dirac(t) + 2*cos(omega)*Dy - D2y; conds = [y(...

Solving a second order differential equation with matlab.

Try this: syms omega x(t) y(t) z t Dy = diff(y); D2y = diff(Dy); Eqn = y == dirac(t) + 2*cos(omega)*Dy - D2y; conds = [y(...

12 hours ago | 0

Answered

How to acieve a scatter plot like this.

Use the surf (link) function and the view (link) function: M = nan(50); M(10:40, 5:30) = rand(31,26); figure surf(M) vi...

How to acieve a scatter plot like this.

Use the surf (link) function and the view (link) function: M = nan(50); M(10:40, 5:30) = rand(31,26); figure surf(M) vi...

12 hours ago | 0

Answered

Drawing Lines on a Graph

If you do not have the Mapping Toolbox, this will likely work: V = linspace(0, 30); % A...

Drawing Lines on a Graph

If you do not have the Mapping Toolbox, this will likely work: V = linspace(0, 30); % A...

1 day ago | 0

Answered

multiple vectors interpolation?

To interpoolate a matrix of row vectors, something like this will work: Vectors = rand(4, 10); ...

multiple vectors interpolation?

To interpoolate a matrix of row vectors, something like this will work: Vectors = rand(4, 10); ...

1 day ago | 0

Answered

How to filter low frequency data set?

If I understand correctly what you want to do, you do not need the loop. Try this: [D,S,R] = xlsread('ScanAnalysis2.csv'); ...

How to filter low frequency data set?

If I understand correctly what you want to do, you do not need the loop. Try this: [D,S,R] = xlsread('ScanAnalysis2.csv'); ...

1 day ago | 0

Answered

How can ı do spike sorting to filtered EEG signal.

Try this: D = load('samp.mat'); samp = D.samp; data = 1E-3; % What Are ‘d...

How can ı do spike sorting to filtered EEG signal.

Try this: D = load('samp.mat'); samp = D.samp; data = 1E-3; % What Are ‘d...

1 day ago | 1

| accepted

Answered

plot3 for three dimension data

I can’t determine why it’s not automatically displaying. Use the view (link) function to make it magically appear: Fspace =...

plot3 for three dimension data

I can’t determine why it’s not automatically displaying. Use the view (link) function to make it magically appear: Fspace =...

1 day ago | 0

Answered

How can I get proper length of FFT

To have the correct amplitudes, scale the fft by dividing it by the length of the original signal. The ‘nfft’ argument (usually...

How can I get proper length of FFT

To have the correct amplitudes, scale the fft by dividing it by the length of the original signal. The ‘nfft’ argument (usually...

1 day ago | 1

Answered

No text appearing in my .txt file using fprintf

I’ve never seen that particular syntax. Try this: fid1 = fopen(wavfilecd,'w'); fprintf(fid1,'%s \t %s \t %s \n',...

No text appearing in my .txt file using fprintf

I’ve never seen that particular syntax. Try this: fid1 = fopen(wavfilecd,'w'); fprintf(fid1,'%s \t %s \t %s \n',...

2 days ago | 0

| accepted

Answered

How can I get the maximum line of multiple graphs, starting from different x-values?

This was something of a challenge! The Code — hold all t =0:0.01:2*pi; x=sin(t); hL(1)=plot(t-0.5,x+1); hL(2)=plot(t+0....

How can I get the maximum line of multiple graphs, starting from different x-values?

This was something of a challenge! The Code — hold all t =0:0.01:2*pi; x=sin(t); hL(1)=plot(t-0.5,x+1); hL(2)=plot(t+0....

2 days ago | 0

| accepted

Answered

nonlinear constrain error must return real value

The expression beginning with ‘x(13)’ contains a log argument that could become negative if ‘x(11)’ is greater than 150, and sim...

nonlinear constrain error must return real value

The expression beginning with ‘x(13)’ contains a log argument that could become negative if ‘x(11)’ is greater than 150, and sim...

3 days ago | 0

Answered

Sparse matrix in OLS , sparse matrix transpose and multiply

See if the lsqr (link) function will do what you want.

Sparse matrix in OLS , sparse matrix transpose and multiply

See if the lsqr (link) function will do what you want.

3 days ago | 0

Answered

How to fill the space between these lines?

The easiest way is to define two overlapping rectangles: figure hold all patch([L1(end,1); R1(end,1); flipud([L1(end,1); R1(...

How to fill the space between these lines?

The easiest way is to define two overlapping rectangles: figure hold all patch([L1(end,1); R1(end,1); flipud([L1(end,1); R1(...

3 days ago | 1

| accepted

Answered

Rotating and shifting a meshgrid

One approach: %Create the meshgrid Xinit = 0:3125:800000; Yinit = 0:3125:800000; [Xq,Yq] = meshgrid(Xinit,Yinit); Z = sin(...

Rotating and shifting a meshgrid

One approach: %Create the meshgrid Xinit = 0:3125:800000; Yinit = 0:3125:800000; [Xq,Yq] = meshgrid(Xinit,Yinit); Z = sin(...

4 days ago | 0

| accepted

Answered

Char function for a cell array

Try this: Name = {'MATE' 'GEAR' 'FIVE' 'SLOW'}; Name = reshape(Name, [], 1); NameC = cell2mat(Name) producing: NameC = ...

Char function for a cell array

Try this: Name = {'MATE' 'GEAR' 'FIVE' 'SLOW'}; Name = reshape(Name, [], 1); NameC = cell2mat(Name) producing: NameC = ...

4 days ago | 0

Answered

Finding ALL the indicies that match a certain value

Use the find function: A = 4; B = [ 3 5 4 6 4 6 7 ]; idx = find(B == A) producing: idx = 3 5

Finding ALL the indicies that match a certain value

Use the find function: A = 4; B = [ 3 5 4 6 4 6 7 ]; idx = find(B == A) producing: idx = 3 5

4 days ago | 1

Answered

How to use log/exponential forms for line of best fit?

You could do a log transformation, however that distorts the errors and (unless the errors are negligable), a less than optimum ...

How to use log/exponential forms for line of best fit?

You could do a log transformation, however that distorts the errors and (unless the errors are negligable), a less than optimum ...

4 days ago | 0

Answered

How can I solve this vector lenght problem?

Change your ‘tankmodel’ function to this and it works: function dydt = tankmodel(t,yv) format long %%%Dataset Parameters W...

How can I solve this vector lenght problem?

Change your ‘tankmodel’ function to this and it works: function dydt = tankmodel(t,yv) format long %%%Dataset Parameters W...

4 days ago | 1

| accepted

Answered

Solving non linear equation for x

Using the Optimization Toolbox fsolve function: eqn = @(x) x.^2 .* log(0.4956./x) - (1-x).^2 .* log(0.47198./(1-x)); xval = f...

Solving non linear equation for x

Using the Optimization Toolbox fsolve function: eqn = @(x) x.^2 .* log(0.4956./x) - (1-x).^2 .* log(0.47198./(1-x)); xval = f...

4 days ago | 0

Answered

Make x axis ticks and extent match

We can’t run your code. You appear to be using 4 different date vectors, one for each subplot. It may be worth exploring them ...

Make x axis ticks and extent match

We can’t run your code. You appear to be using 4 different date vectors, one for each subplot. It may be worth exploring them ...

4 days ago | 0

Answered

How can I get the main peaks from a signal with a lot of noises?

That appears to be a Fourier transform of a noisy signal. If so, because the noise is broadband, a frequency-selective filter o...

How can I get the main peaks from a signal with a lot of noises?

That appears to be a Fourier transform of a noisy signal. If so, because the noise is broadband, a frequency-selective filter o...

5 days ago | 0

| accepted

Answered

Bar chart colors depending on their value

Try this: req = [10,5,3]; data=[9,6,3]; hb1 = bar(req,0.5); newXticklabel = {'label1','label2','label3'}; set(gca,'Xtick...

Bar chart colors depending on their value

Try this: req = [10,5,3]; data=[9,6,3]; hb1 = bar(req,0.5); newXticklabel = {'label1','label2','label3'}; set(gca,'Xtick...

5 days ago | 1

| accepted

Answered

How do I save my data from each loop iteration into a single matrix?

Without knowing what size your variables ‘rf_data’ and ‘tstart’ are, the easiest way would be to save them to cell arrays, then ...

How do I save my data from each loop iteration into a single matrix?

Without knowing what size your variables ‘rf_data’ and ‘tstart’ are, the easiest way would be to save them to cell arrays, then ...

5 days ago | 0

Answered

How to 'crop' a graph?

I’m not certain what you want. One solution: % Plot u time history zci = @(v) find(v(:).*circshift(v(:), [-1 0]) <= 0); ...

How to 'crop' a graph?

I’m not certain what you want. One solution: % Plot u time history zci = @(v) find(v(:).*circshift(v(:), [-1 0]) <= 0); ...

5 days ago | 0

| accepted

Answered

Code seems to not be printing out the value I need, as well as not graphing points on the figure. Need help, I don't know how to fix this.

Now I can read it, although understranding your notes remains a problem. You still have not described what you want to do wit...

Code seems to not be printing out the value I need, as well as not graphing points on the figure. Need help, I don't know how to fix this.

Now I can read it, although understranding your notes remains a problem. You still have not described what you want to do wit...

5 days ago | 0

Answered

I want to plot axes with actual dimensions, in inches.

See the axes documentation section on 'Units' for a discussion on how to set them.

I want to plot axes with actual dimensions, in inches.

See the axes documentation section on 'Units' for a discussion on how to set them.

5 days ago | 0

Answered

How can I combine those lines into a surface (plot3) to surface

See if this does what you want: T_Mtx = ([1.4; 1.2; 1; 0.8; 0.6] * ones(1,10))'; SOI = xlsread('internal_2.xlsx', 1, 'A2:A1...

How can I combine those lines into a surface (plot3) to surface

See if this does what you want: T_Mtx = ([1.4; 1.2; 1; 0.8; 0.6] * ones(1,10))'; SOI = xlsread('internal_2.xlsx', 1, 'A2:A1...

5 days ago | 0

| accepted

Answered

MATLAB function for finding intersection points between line and multiple polygon

One option is to use the inpolygon function: rctnglx = [1 1 3 3 1]; % Create Data rctngly = ...

MATLAB function for finding intersection points between line and multiple polygon

One option is to use the inpolygon function: rctnglx = [1 1 3 3 1]; % Create Data rctngly = ...

5 days ago | 0

| accepted

Answered

In the code below, what does ind do?

It evaluates a function called ‘ff’ with the argument ‘pop’, and assigns it to the variable ‘cost’. It then sorts ‘cost’, gets ...

In the code below, what does ind do?

It evaluates a function called ‘ff’ with the argument ‘pop’, and assigns it to the variable ‘cost’. It then sorts ‘cost’, gets ...

5 days ago | 1

| accepted