12 767 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

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; ...

ungefär 6 timmar 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...

ungefär 7 timmar 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...

ungefär 7 timmar 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.

ungefär 8 timmar 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); ...

ungefär 8 timmar 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...

ungefär 10 timmar ago | 0

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...

ungefär 21 timmar ago | 0

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 ...

en dag 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...

en dag 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); ...

en dag 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...

en dag 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...

2 dagar 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 ...

2 dagar 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...

2 dagar 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 ...

2 dagar 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 ...

2 dagar 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...

2 dagar 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...

3 dagar 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 -...

3 dagar 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...

3 dagar ago | 1

Answered

Array indices must be positive integers or logical values

The problem: for k=0:M-1 The solution: for k=1:M In MATLAB, subscript indices begin at 1, not 0, and are defined as intege...

Array indices must be positive integers or logical values

The problem: for k=0:M-1 The solution: for k=1:M In MATLAB, subscript indices begin at 1, not 0, and are defined as intege...

3 dagar ago | 0

| accepted

Answered

Wrong answer for sine function

Define ‘t’ in terms of days (or fractions of days). Try this: rforce = @(t) 0.3 + 0.2.*sin(2.*pi.*t/365 - pi/2); tdays =...

Wrong answer for sine function

Define ‘t’ in terms of days (or fractions of days). Try this: rforce = @(t) 0.3 + 0.2.*sin(2.*pi.*t/365 - pi/2); tdays =...

3 dagar ago | 1

| accepted

Answered

Working With Matlab Tables

I created my own table to test my code. (I didn’t post it previously because the other two Answers had already appeared.) Th...

Working With Matlab Tables

I created my own table to test my code. (I didn’t post it previously because the other two Answers had already appeared.) Th...

3 dagar ago | 0

Answered

Ploting two different vectors in the same figure

Use element-wise multiplication, then transpose ‘a’ and ‘b’ to use the references in your plot3 calls. Alos, specifically use t...

Ploting two different vectors in the same figure

Use element-wise multiplication, then transpose ‘a’ and ‘b’ to use the references in your plot3 calls. Alos, specifically use t...

3 dagar ago | 0

| accepted

Answered

plot with a few sample marked.

Try these: x= 1:0.01:40; y = cos(x); L1 = y <= 0.5; % Logical Index: y <= 0.5 figure pl...

plot with a few sample marked.

Try these: x= 1:0.01:40; y = cos(x); L1 = y <= 0.5; % Logical Index: y <= 0.5 figure pl...

3 dagar ago | 0

Answered

how can i save struct in file txt?

Use the save function to save it as a .mat file.

how can i save struct in file txt?

Use the save function to save it as a .mat file.

3 dagar ago | 1

| accepted

Answered

Circle centers plot aren't in the same place as the circles in a figure

I cannot run your code. However, since ‘centersStrong’ is a two-column matrix of the x and y coordinates, your plot call woul...

Circle centers plot aren't in the same place as the circles in a figure

I cannot run your code. However, since ‘centersStrong’ is a two-column matrix of the x and y coordinates, your plot call woul...

3 dagar ago | 0

| accepted

Answered

The question about DC component!

Removing the DC component is useful in showing the other peaks in the Fourier transform of your signal, if there is a very high ...

The question about DC component!

Removing the DC component is useful in showing the other peaks in the Fourier transform of your signal, if there is a very high ...

4 dagar ago | 0

| accepted

Answered

fprintf conversion character use \c or \s?

Putting character arrays and numeric variable types together in a matrix is not appropriate. Try this instead: countries = ...

fprintf conversion character use \c or \s?

Putting character arrays and numeric variable types together in a matrix is not appropriate. Try this instead: countries = ...

4 dagar ago | 0

Answered

Error when solving an equation involving a poisson pdf

Try this (instead of using the Symbolic Math Toolbox): lambda = fzero(@(lambda) poisspdf(10, lambda) - 0.1, 5) producing: l...

Error when solving an equation involving a poisson pdf

Try this (instead of using the Symbolic Math Toolbox): lambda = fzero(@(lambda) poisspdf(10, lambda) - 0.1, 5) producing: l...

4 dagar ago | 0

| accepted