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

Plotting a line given its slope and one coordinate

Try this: x = 88; y = 56; slope = 1.08; y_intercept = y - slope*x; xv = [0 100]; figure plot(xv, slope*xv+y_intercep...

Plotting a line given its slope and one coordinate

Try this: x = 88; y = 56; slope = 1.08; y_intercept = y - slope*x; xv = [0 100]; figure plot(xv, slope*xv+y_intercep...

6 hours ago | 0

Answered

Need help displaying an output file for data.

I have no idea what you want to do. However if you create a table of your results, writetable could do what you want.

Need help displaying an output file for data.

I have no idea what you want to do. However if you create a table of your results, writetable could do what you want.

7 hours ago | 1

| accepted

Answered

Error Message Using ODE45

The code you posted runs for me without error: function dydt = vdp1(t,y) %VDP1 Evaluate the van der Pol ODEs for mu = 1 % ...

Error Message Using ODE45

The code you posted runs for me without error: function dydt = vdp1(t,y) %VDP1 Evaluate the van der Pol ODEs for mu = 1 % ...

9 hours ago | 0

Answered

Repeat 3-D array elements

Use the repmat function: A = rand(67, 960, 80); B = repmat(A, 1, 1, 3); sizeB = size(B) producing: sizeB = 67 960 ...

Repeat 3-D array elements

Use the repmat function: A = rand(67, 960, 80); B = repmat(A, 1, 1, 3); sizeB = size(B) producing: sizeB = 67 960 ...

13 hours ago | 0

Answered

AREA UNDER the CURVE

Defining your matrix as ‘M’, use the trapz function twice, once in each dimension: AUC = trapz(trapz(M)) producing: AUC = ...

AREA UNDER the CURVE

Defining your matrix as ‘M’, use the trapz function twice, once in each dimension: AUC = trapz(trapz(M)) producing: AUC = ...

16 hours ago | 0

| accepted

Answered

Fitting data in x,y to a known function

Use the fminsearch function to fit your data: x1 = linspace(1,32,32); y1 = [0.01 0.02 0.02 0.02 0.02 0.02 0.03 0.03 0.03 0.04...

Fitting data in x,y to a known function

Use the fminsearch function to fit your data: x1 = linspace(1,32,32); y1 = [0.01 0.02 0.02 0.02 0.02 0.02 0.03 0.03 0.03 0.04...

17 hours ago | 0

Answered

How can my function work?

Either change the function output to ‘Wans’: function Wans = fishing_load_factor(t) or change the ‘Wans’ within it to ‘W’.

How can my function work?

Either change the function output to ‘Wans’: function Wans = fishing_load_factor(t) or change the ‘Wans’ within it to ‘W’.

17 hours ago | 0

Answered

error bars in bar plot with categories

This seems to be an XOR situation. Apparently, it is possible to have categorical x-values or errorbar bars but not both. Th...

error bars in bar plot with categories

This seems to be an XOR situation. Apparently, it is possible to have categorical x-values or errorbar bars but not both. Th...

20 hours ago | 0

| accepted

Answered

Plot dB/dt vs. time by ODE45 (coupled differential equations)

One option is to loop through the ‘odes’ function with the time vector and solved values for ‘varsol’. A much easier option i...

Plot dB/dt vs. time by ODE45 (coupled differential equations)

One option is to loop through the ‘odes’ function with the time vector and solved values for ‘varsol’. A much easier option i...

21 hours ago | 1

Answered

How to integrate after a derivative?

The result you want is not obvious. This runs without error, however you will need to determine if the result is what you wan...

How to integrate after a derivative?

The result you want is not obvious. This runs without error, however you will need to determine if the result is what you wan...

1 day ago | 0

Answered

Remove the 50 Hz Hum from a Signal

The designfilt call designs a second-order Butterworth filter. It appears to be correct when I analyse it with freqz. Without ...

Remove the 50 Hz Hum from a Signal

The designfilt call designs a second-order Butterworth filter. It appears to be correct when I analyse it with freqz. Without ...

1 day ago | 0

Answered

Fitting 2 data sets simultaneously using two different equations with some shared fit parameters.

Try this: global_fit_data = [A; B].'; % A and B are vectors of size 1X85 t = (0:10:840).'; global_fit_function = @(p,t) [p(3...

Fitting 2 data sets simultaneously using two different equations with some shared fit parameters.

Try this: global_fit_data = [A; B].'; % A and B are vectors of size 1X85 t = (0:10:840).'; global_fit_function = @(p,t) [p(3...

1 day ago | 0

| accepted

Answered

how to i change the x-axis from time to angle with this data?

Without your code, an exact respoinse is not possible. See for example XTick and XTickLabel.

how to i change the x-axis from time to angle with this data?

Without your code, an exact respoinse is not possible. See for example XTick and XTickLabel.

2 days ago | 0

Answered

How can I solve a set of equations using a function handle?

Try this: BigLambdaFunction = @(p,t,T) 1 - p(1).*((p(2)-(t-T))./(p(2)-t)).*exp((p(1).*T)./p(2)) biglambda = [ 0.0455 0....

How can I solve a set of equations using a function handle?

Try this: BigLambdaFunction = @(p,t,T) 1 - p(1).*((p(2)-(t-T))./(p(2)-t)).*exp((p(1).*T)./p(2)) biglambda = [ 0.0455 0....

2 days ago | 0

| accepted

Answered

@FinalProject_ode must return a column vector (solved)

Assuming all the elements are scalars, either transpose ‘dydt’ or put semicolons between the elements: dydt = [dPPARuFFA; dPPA...

@FinalProject_ode must return a column vector (solved)

Assuming all the elements are scalars, either transpose ‘dydt’ or put semicolons between the elements: dydt = [dPPARuFFA; dPPA...

2 days ago | 0

Answered

How to fix the code

If you want to set ‘N’ to the row size of ‘DATA’, this is preferable: N = size(DATA,1); Perhaps you intend to read the entir...

How to fix the code

If you want to set ‘N’ to the row size of ‘DATA’, this is preferable: N = size(DATA,1); Perhaps you intend to read the entir...

2 days ago | 0

| accepted

Answered

Should I shift my fft function?

It depends on the result you want. The shifted version plots the negative and positve frequencies (the Fourier transform is sym...

Should I shift my fft function?

It depends on the result you want. The shifted version plots the negative and positve frequencies (the Fourier transform is sym...

2 days ago | 0

| accepted

Answered

Matlab Outputting answers as fractions

You are still in the Symbolic Math Toolbox environment. Try one of these (depending on the rresult you want): X = vpa(linso...

Matlab Outputting answers as fractions

You are still in the Symbolic Math Toolbox environment. Try one of these (depending on the rresult you want): X = vpa(linso...

2 days ago | 1

| accepted

Answered

Multiplying a 3x3 matrix where values change with each iteration by a 3x1 matrix with values that iterate

What part of my Comment to your previous post Struggling with iterative matrix multiplication does not work?

Multiplying a 3x3 matrix where values change with each iteration by a 3x1 matrix with values that iterate

What part of my Comment to your previous post Struggling with iterative matrix multiplication does not work?

2 days ago | 0

Answered

Highpass Filter Sound Help

Store the filtered signals in a cell array (easiest). Then use the playblocking function to play them back one after the other ...

Highpass Filter Sound Help

Store the filtered signals in a cell array (easiest). Then use the playblocking function to play them back one after the other ...

3 days ago | 0

| accepted

Answered

Why it plots more than just one point and how do I get rid of them

The code plots more than one point because you told it to. Revised code: function xp=h2(t,x) xp=zeros(2,1); xp(1)=(x(2)) ...

Why it plots more than just one point and how do I get rid of them

The code plots more than one point because you told it to. Revised code: function xp=h2(t,x) xp=zeros(2,1); xp(1)=(x(2)) ...

3 days ago | 0

Answered

how to get rid of error which says too many output arguments

The ‘test3’ function needs to be: function xdot = test3(t,x) xdot(1)=x(2); xdot(2)= 10*(-2*x3 + x2); xdot=xdot'; end and ...

how to get rid of error which says too many output arguments

The ‘test3’ function needs to be: function xdot = test3(t,x) xdot(1)=x(2); xdot(2)= 10*(-2*x3 + x2); xdot=xdot'; end and ...

3 days ago | 0

Answered

Add error bars to grouped bar plot

See: Adding standard error bars to grouped bar graph

Add error bars to grouped bar plot

See: Adding standard error bars to grouped bar graph

3 days ago | 0

Answered

Multiple outputs from anonymous function

One option is to have the two outputs to one vector, then separate them in a subsequent assignment: demo_fcn = @(in) [in(1) in...

Multiple outputs from anonymous function

One option is to have the two outputs to one vector, then separate them in a subsequent assignment: demo_fcn = @(in) [in(1) in...

3 days ago | 0

Answered

How to show surface plot of 2D data?

Try this (with your own vectors): x = rand(10,1); % Create Data y = rand(10,1); ...

How to show surface plot of 2D data?

Try this (with your own vectors): x = rand(10,1); % Create Data y = rand(10,1); ...

3 days ago | 1

| accepted

Answered

Mldivide gives rank deficency when solving for large full system

See if the lsqr function will do what you want. Another option is to use pinv to do the matrix inversion (not normally an app...

Mldivide gives rank deficency when solving for large full system

See if the lsqr function will do what you want. Another option is to use pinv to do the matrix inversion (not normally an app...

3 days ago | 0

Answered

i am not able to import excel sheet

One approach would be to open Excel, then save your spreadsheet as a .txt file (likely a comma-delimited text file). Then impor...

i am not able to import excel sheet

One approach would be to open Excel, then save your spreadsheet as a .txt file (likely a comma-delimited text file). Then impor...

3 days ago | 0

Answered

diff makes M less than what i want by 1 elment and i want to have second derivaitve numircal

Use the gradient function. Specifically: k = 0:0.1:5; figure(4) E=(k.^2)*(1.0540^2)/(2*1000*9.1); fx=gradient(E)./grad...

diff makes M less than what i want by 1 elment and i want to have second derivaitve numircal

Use the gradient function. Specifically: k = 0:0.1:5; figure(4) E=(k.^2)*(1.0540^2)/(2*1000*9.1); fx=gradient(E)./grad...

3 days ago | 0

Answered

Hello, how to solve this equation E*I*k^4-m*v^2*k^2+2*m*v*w*k+(m+M)w^2=0 numerically where w is variable,

Supply all the scalar parameters, then: Eqn = @(w) E*I*k^2-m*v^2*k^2+2*m*v*w*k+(m+M)w^2; w0 = 42; [w,fval] = fsolve(Eqn, ...

Hello, how to solve this equation E*I*k^4-m*v^2*k^2+2*m*v*w*k+(m+M)w^2=0 numerically where w is variable,

Supply all the scalar parameters, then: Eqn = @(w) E*I*k^2-m*v^2*k^2+2*m*v*w*k+(m+M)w^2; w0 = 42; [w,fval] = fsolve(Eqn, ...

3 days ago | 0

| accepted

Answered

Plot ODE Bond Price Model

Not enough information, so I created the missing variables: tv = linspace(0, 100, 25); % Time...

Plot ODE Bond Price Model

Not enough information, so I created the missing variables: tv = linspace(0, 100, 25); % Time...

3 days ago | 0