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 fix my legend?

For every plot call, return a handle: h1 = plot(a1,b1,'ko','LineWidth',3); . . . h2 = plot(c1,d1,'bo','LineWidth'...

How do I fix my legend?

For every plot call, return a handle: h1 = plot(a1,b1,'ko','LineWidth',3); . . . h2 = plot(c1,d1,'bo','LineWidth'...

ungefär 3 timmar ago | 0

| accepted

Answered

Extract hourly data from minute data over a year

Try this: T1 = readtable('weather_data_2019.txt'); Idx = minute(T1.Datetime) == 0; OutTable = T1(Idx,:) producing (for this...

Extract hourly data from minute data over a year

Try this: T1 = readtable('weather_data_2019.txt'); Idx = minute(T1.Datetime) == 0; OutTable = T1(Idx,:) producing (for this...

ungefär 6 timmar ago | 1

| accepted

Answered

How can you make an input to a symbolic variable?

Try this: varprompt='Enter Variable (space-separated):'; var=inputdlg(varprompt) v = regexp(var, ',', 'split') syms(v{:}) ...

How can you make an input to a symbolic variable?

Try this: varprompt='Enter Variable (space-separated):'; var=inputdlg(varprompt) v = regexp(var, ',', 'split') syms(v{:}) ...

ungefär 7 timmar ago | 0

Answered

How to plot both real and imaginary part of complex exponential?

See my Answer to your duplicate Question: How to plot both real and imaginary part of complex exponential?

How to plot both real and imaginary part of complex exponential?

See my Answer to your duplicate Question: How to plot both real and imaginary part of complex exponential?

ungefär 7 timmar ago | 0

Answered

Numerical integration in MATLAB

Try this: c = @(T) (h.^2 .* D) ./ (2 .* pi * pi * vs * kb .* T .* T); fun = @(x,T) ((x.^4 .* exp((h.*x) ./ (kb .* T))) ./ (((...

Numerical integration in MATLAB

Try this: c = @(T) (h.^2 .* D) ./ (2 .* pi * pi * vs * kb .* T .* T); fun = @(x,T) ((x.^4 .* exp((h.*x) ./ (kb .* T))) ./ (((...

ungefär 9 timmar ago | 0

| accepted

Answered

Interpolate NaN on graph

If the data have NaN as the value of the dependent variable, and the independent variable is continuous (with no NaN values), th...

Interpolate NaN on graph

If the data have NaN as the value of the dependent variable, and the independent variable is continuous (with no NaN values), th...

ungefär 9 timmar ago | 0

| accepted

Answered

Finding all the zeroes of a discontinuous function in a particular range

It may be version-dependent. In R2020b (Update 1), I get: extrema = 13.3333 -1.0 ans = -26.666666666666666666666...

Finding all the zeroes of a discontinuous function in a particular range

It may be version-dependent. In R2020b (Update 1), I get: extrema = 13.3333 -1.0 ans = -26.666666666666666666666...

ungefär 10 timmar ago | 0

| accepted

Answered

EMG bandpass filter to remove 50 Hz power line

With a sampling frequency of 10 Hz, the highest frequency that can be uniquely represented is 5 Hz, which is much too low for an...

EMG bandpass filter to remove 50 Hz power line

With a sampling frequency of 10 Hz, the highest frequency that can be uniquely represented is 5 Hz, which is much too low for an...

ungefär 10 timmar ago | 0

Answered

error in my code

The way you coded ‘R’: R=1000*[5, 100, 200, 250]; it only has 4 elements. Nothing exists beyond ‘R(4)’.

error in my code

The way you coded ‘R’: R=1000*[5, 100, 200, 250]; it only has 4 elements. Nothing exists beyond ‘R(4)’.

ungefär 12 timmar ago | 1

Answered

Finding Best Fit for Log Scaled Graphs

It is best to fit the power function using a nonlinear approach: x = [0, 0.00027036151034654, 0.00115093883458806, 0.002234322...

Finding Best Fit for Log Scaled Graphs

It is best to fit the power function using a nonlinear approach: x = [0, 0.00027036151034654, 0.00115093883458806, 0.002234322...

ungefär 12 timmar ago | 0

Answered

How to plot both real and imaginary part of complex exponential?

For best results, replace ‘j’ with ‘1j’, then convert the result to double to use plot (since fplot is likely to be more difficu...

How to plot both real and imaginary part of complex exponential?

For best results, replace ‘j’ with ‘1j’, then convert the result to double to use plot (since fplot is likely to be more difficu...

ungefär 14 timmar ago | 1

Answered

Changing the legend color

Try something like this: y = linspace(0,50,50); % Create Data v = 1:14; ...

Changing the legend color

Try something like this: y = linspace(0,50,50); % Create Data v = 1:14; ...

en dag ago | 0

| accepted

Answered

plotting concentric circles using contour

Use the axis function, specifically either: axis('equal') % Function Expression or: axis equal ...

plotting concentric circles using contour

Use the axis function, specifically either: axis('equal') % Function Expression or: axis equal ...

en dag ago | 0

| accepted

Answered

Graph help in matlab

This is not your function, however it illustrates the ‘logical indexing’ approach to such problems: f = @(x) (2-2*x).*(x <= 0)...

Graph help in matlab

This is not your function, however it illustrates the ‘logical indexing’ approach to such problems: f = @(x) (2-2*x).*(x <= 0)...

en dag ago | 0

Answered

Pseudo Element by Element Vector Subtraction

See if this does what you want: C1 = A(:,1).' - B(:,1); % Col #1 In ‘A’ - Col #1 I...

Pseudo Element by Element Vector Subtraction

See if this does what you want: C1 = A(:,1).' - B(:,1); % Col #1 In ‘A’ - Col #1 I...

en dag ago | 0

| accepted

Answered

Numbers in command window printed 10000 times smaller

I suspect there is an exponent indication out-of-view in the image you posted. When I read and reshape your file as in your p...

Numbers in command window printed 10000 times smaller

I suspect there is an exponent indication out-of-view in the image you posted. When I read and reshape your file as in your p...

en dag ago | 0

| accepted

Answered

How to write Pearcey functions?

I would code them as: Pe1 = @(x) integral(@(s) exp(1i*(s.^4 + s.^2.*x)), -Inf, Inf, 'ArrayValued',1); Pe2 = @(x,y) integral(@...

How to write Pearcey functions?

I would code them as: Pe1 = @(x) integral(@(s) exp(1i*(s.^4 + s.^2.*x)), -Inf, Inf, 'ArrayValued',1); Pe2 = @(x,y) integral(@...

en dag ago | 0

Answered

Is there any ways to find all elements' rows and cols number at once?

Meet the size function!

Is there any ways to find all elements' rows and cols number at once?

Meet the size function!

en dag ago | 0

Answered

Separate a time signal for each frequency

The pspectrum function (introduced in R2017b) with the 'spectrogram' type may be what you want. It produces a spectrogram plot ...

Separate a time signal for each frequency

The pspectrum function (introduced in R2017b) with the 'spectrogram' type may be what you want. It produces a spectrogram plot ...

en dag ago | 0

Answered

Error when using fminsearch to find least squares fit of data using a given equation

I can’t figure out from your code what your independent and dependent variables are. As a general rule, the argument to fmins...

Error when using fminsearch to find least squares fit of data using a given equation

I can’t figure out from your code what your independent and dependent variables are. As a general rule, the argument to fmins...

en dag ago | 0

Answered

How do I convert a transfer function of a low pass filter to bandpass?

If you want to use the Signal Processing Toolbox functions, this works: syms s; N=4; for k=1:N w=((2*k+N-1)/(2*N))*pi; ...

How do I convert a transfer function of a low pass filter to bandpass?

If you want to use the Signal Processing Toolbox functions, this works: syms s; N=4; for k=1:N w=((2*k+N-1)/(2*N))*pi; ...

2 dagar ago | 0

Answered

Designing a bandpass filter

See if the bandpass fucntion works for you.

Designing a bandpass filter

See if the bandpass fucntion works for you.

2 dagar ago | 0

| accepted

Answered

How to select every second number from a file of numbers separated by a comma

I looked at ‘UE1.txt’ and I initially could not make any sense out of it. It’s apparently supposed to be a multi-channel record...

How to select every second number from a file of numbers separated by a comma

I looked at ‘UE1.txt’ and I initially could not make any sense out of it. It’s apparently supposed to be a multi-channel record...

2 dagar ago | 0

| accepted

Answered

plotting a graph with different conditions using if statement

Your code can be made significantly more efficient by using vectorisation and ‘logical indesing’: mu_a1 = 0.1; %absorption coe...

plotting a graph with different conditions using if statement

Your code can be made significantly more efficient by using vectorisation and ‘logical indesing’: mu_a1 = 0.1; %absorption coe...

2 dagar ago | 1

| accepted

Answered

Deleting Some initials of The Matrix

It depends on the functions you have available. It appears to be a text file, so one option would be textscan: fidi = fopen('...

Deleting Some initials of The Matrix

It depends on the functions you have available. It appears to be a text file, so one option would be textscan: fidi = fopen('...

3 dagar ago | 0

| accepted

Answered

Requesting help for piecewise ploting

The Symbolic Math Toolbox and here particularly the piecewise funciton may not be the best option for this problem. Use ordin...

Requesting help for piecewise ploting

The Symbolic Math Toolbox and here particularly the piecewise funciton may not be the best option for this problem. Use ordin...

3 dagar ago | 0

Answered

Need Help New to MATLAB

To make them not be fractions, use vpasolve or vpa on the result: F2s = vpasolve(Fwy+F1y+F2y == 0,F2) F1s = vpasolve(Fwx+F1x+...

Need Help New to MATLAB

To make them not be fractions, use vpasolve or vpa on the result: F2s = vpasolve(Fwy+F1y+F2y == 0,F2) F1s = vpasolve(Fwx+F1x+...

3 dagar ago | 0

| accepted

Answered

Matlab returns empty symbol when solving laplace transform

Try this: syms s t C1 C2 R1 R2 i(t) I(s) eqn(t) = 0 == R1*i(t) + R2*i(t) + diff(i(t), t)/10 + int(i(t), t)/C1 + int(i(t), t)/...

Matlab returns empty symbol when solving laplace transform

Try this: syms s t C1 C2 R1 R2 i(t) I(s) eqn(t) = 0 == R1*i(t) + R2*i(t) + diff(i(t), t)/10 + int(i(t), t)/C1 + int(i(t), t)/...

3 dagar ago | 0

Answered

Ploting an anonymous function

It appears that ‘Cw’ also needs to be an anonymous funciton, however it is absolutely not obvious what variable it supposed to b...

Ploting an anonymous function

It appears that ‘Cw’ also needs to be an anonymous funciton, however it is absolutely not obvious what variable it supposed to b...

3 dagar ago | 0

Answered

Need the function or Equation that solve this kind of questions?

This is not your function, however it illustrates the ‘logical indexing’ approach: f = @(x) (2-2*x).*(x <= 0) + (2+2*x).*(x>0)...

Need the function or Equation that solve this kind of questions?

This is not your function, however it illustrates the ‘logical indexing’ approach: f = @(x) (2-2*x).*(x <= 0) + (2+2*x).*(x>0)...

3 dagar ago | 0