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

Does audioread not return a vector?

It depends on your audio file. A stereophonic signal will return an (N x 2) matrix, with the first column being the left channe...

Does audioread not return a vector?

It depends on your audio file. A stereophonic signal will return an (N x 2) matrix, with the first column being the left channe...

6 hours ago | 0

| accepted

Answered

amplitude plot not working

Your ‘A’ vector has purely imaginary components. Try this: plot(omega, imag(A))

amplitude plot not working

Your ‘A’ vector has purely imaginary components. Try this: plot(omega, imag(A))

7 hours ago | 0

Answered

How would I add labels to points?

Use the text (link) function. You will likely also need the sprintf function.

How would I add labels to points?

Use the text (link) function. You will likely also need the sprintf function.

9 hours ago | 0

Answered

RMSE of sequences in cell arrays with different length

I am not certain what final result you want. This should get you started: subt = cellfun(@minus, YTest, YPred, 'Uni',0); ...

RMSE of sequences in cell arrays with different length

I am not certain what final result you want. This should get you started: subt = cellfun(@minus, YTest, YPred, 'Uni',0); ...

10 hours ago | 0

Answered

How can I generate reciprocal of a matrix

It depends on what you mean by ‘reciprocal’. If you want ‘X’ such that: A*X = eye(size(A,1)) then: X1 = inv(A); ...

How can I generate reciprocal of a matrix

It depends on what you mean by ‘reciprocal’. If you want ‘X’ such that: A*X = eye(size(A,1)) then: X1 = inv(A); ...

10 hours ago | 0

Answered

How can print out the below content by MATLAB program?

You do not need the second for loop. Simply print the value of ‘j’ in each iteration of the ‘i’ loop: for i = 1:1:5 j =i...

How can print out the below content by MATLAB program?

You do not need the second for loop. Simply print the value of ‘j’ in each iteration of the ‘i’ loop: for i = 1:1:5 j =i...

12 hours ago | 1

| accepted

Answered

ERROR message when running code

Your code plots all three variables. Note that they only differ by phase, so the easiest way to detect the difference is where ...

ERROR message when running code

Your code plots all three variables. Note that they only differ by phase, so the easiest way to detect the difference is where ...

13 hours ago | 1

| accepted

Answered

LaTex with 2 strings separated by a num2str

Try this: errordisplay=[' $\varepsilon_{RTP}=$ ',num2str(rtep),'\%']; It seems you need to ‘escape’ the ‘%’.

LaTex with 2 strings separated by a num2str

Try this: errordisplay=[' $\varepsilon_{RTP}=$ ',num2str(rtep),'\%']; It seems you need to ‘escape’ the ‘%’.

1 day ago | 1

| accepted

Answered

Matrix Row Addition Question

There are several ways to do what you want. Here’s one: k = zeros(3,6); k(end, 3:6) = 8 : -2 : 2;

Matrix Row Addition Question

There are several ways to do what you want. Here’s one: k = zeros(3,6); k(end, 3:6) = 8 : -2 : 2;

1 day ago | 1

| accepted

Answered

How do I write this equation in Matlab?

You need to add ‘x’ to your syms call: syms x then with this solve call: theta_max = solve(V/V_w ,x) you get: theta_m...

How do I write this equation in Matlab?

You need to add ‘x’ to your syms call: syms x then with this solve call: theta_max = solve(V/V_w ,x) you get: theta_m...

1 day ago | 0

Answered

Text Box location Issue

I would define the axis limits just after the plot call with an axis call. The axis limits will not then change in each iterati...

Text Box location Issue

I would define the axis limits just after the plot call with an axis call. The axis limits will not then change in each iterati...

1 day ago | 1

Answered

How can I simplify complex symbolic equations? Simplify not working

Tell the simplify function to keep working on ‘eqn’ as long as necessary: eqns = simplify(eqn, 'Steps',150) producing: eqn...

How can I simplify complex symbolic equations? Simplify not working

Tell the simplify function to keep working on ‘eqn’ as long as necessary: eqns = simplify(eqn, 'Steps',150) producing: eqn...

1 day ago | 0

| accepted

Answered

3D array to cell array

Use the mat2cell (link) function: A = rand(550, 129, 3); % Create Matrix C = mat2cel...

3D array to cell array

Use the mat2cell (link) function: A = rand(550, 129, 3); % Create Matrix C = mat2cel...

1 day ago | 0

| accepted

Answered

Plotting The bodee plots extracted from LTSPICE simulator

MATLAB can read it, however it needs a bit of help in order to understand how to read it. Try this: fidi = fopen('Data.txt'...

Plotting The bodee plots extracted from LTSPICE simulator

MATLAB can read it, however it needs a bit of help in order to understand how to read it. Try this: fidi = fopen('Data.txt'...

1 day ago | 0

Answered

make one struct with two datasets

Try this: data.features = rand(84, 1190); data.labels = rand(84,1); See the documentation on Create Structure Array (link) f...

make one struct with two datasets

Try this: data.features = rand(84, 1190); data.labels = rand(84,1); See the documentation on Create Structure Array (link) f...

2 days ago | 0

| accepted

Answered

I am trying for filters for my experimental data

My guess is that you used a highpass filter, since it seems that you eliminated the low frequencies and kept the noise. You pro...

I am trying for filters for my experimental data

My guess is that you used a highpass filter, since it seems that you eliminated the low frequencies and kept the noise. You pro...

2 days ago | 0

Answered

how to fit a surface to 3d data points

If your data points are each vectors, try this: x = rand(1, 10); % Create Data y =...

how to fit a surface to 3d data points

If your data points are each vectors, try this: x = rand(1, 10); % Create Data y =...

3 days ago | 0

| accepted

Answered

Fitting Cosine function to many different data sets.

Thi idea I deleted is to use the Angle sum and difference identities (link) to linearise your regression, since linear regressio...

Fitting Cosine function to many different data sets.

Thi idea I deleted is to use the Angle sum and difference identities (link) to linearise your regression, since linear regressio...

3 days ago | 0

| accepted

Answered

Error changing data in table from char to double

The ‘GROSS_QTY’ problem is relatively easy to solve: [~,S] = xlsread('DateAndQuantity.csv'); G_Q = sscanf([S{2:end,2}],'%d;')...

Error changing data in table from char to double

The ‘GROSS_QTY’ problem is relatively easy to solve: [~,S] = xlsread('DateAndQuantity.csv'); G_Q = sscanf([S{2:end,2}],'%d;')...

3 days ago | 0

| accepted

Answered

i need to get the maximum amplitude in this code but my final answer is wrong

‘i am fairly certain my code is wrong’ So am I. Try this: D = load('Data.mat'); f = D.f; t = D.t; dt=t(2)-t(1);% t ve...

i need to get the maximum amplitude in this code but my final answer is wrong

‘i am fairly certain my code is wrong’ So am I. Try this: D = load('Data.mat'); f = D.f; t = D.t; dt=t(2)-t(1);% t ve...

3 days ago | 1

| accepted

Answered

export frequency data from a histogram

Use a handle to return the information from the histogram function, then get the values you want: figure hh = histogram(x); ...

export frequency data from a histogram

Use a handle to return the information from the histogram function, then get the values you want: figure hh = histogram(x); ...

3 days ago | 0

| accepted

Answered

Matlab 2018b adds-on problem

Try this: Download R2018b (includes R2018b Update 4)

Matlab 2018b adds-on problem

Try this: Download R2018b (includes R2018b Update 4)

3 days ago | 0

Answered

In which order does polyfit command display coefficients?

The 1.33 value is the slope, and the -4.5 value is the intercept, so they would appear as [1.33 -4.5]. , corresponding to and ...

In which order does polyfit command display coefficients?

The 1.33 value is the slope, and the -4.5 value is the intercept, so they would appear as [1.33 -4.5]. , corresponding to and ...

3 days ago | 0

| accepted

Answered

Finding the delta (subtraction) of two cells in an existing matrix

Use the diff (link) function, and add a ‘0’ to the output, so the row lengths will be the same: time = [ 1 5 ...

Finding the delta (subtraction) of two cells in an existing matrix

Use the diff (link) function, and add a ‘0’ to the output, so the row lengths will be the same: time = [ 1 5 ...

4 days ago | 0

| accepted

Answered

Dynamic size differential equation system

I have absolutely no idea what you’re doing. Regardless, your ‘deqns’ function must have as two of its arguments your independe...

Dynamic size differential equation system

I have absolutely no idea what you’re doing. Regardless, your ‘deqns’ function must have as two of its arguments your independe...

4 days ago | 0

| accepted

Answered

system of 5 eq and 5 uknowns, FSOLVE error

There are a few errors in your posted code. Corrected: syms Rsa Vsa P3 q Psa Rsab Vsab Csa Pic Rsv Rlv Pvb Rnet ABP Rla re...

system of 5 eq and 5 uknowns, FSOLVE error

There are a few errors in your posted code. Corrected: syms Rsa Vsa P3 q Psa Rsab Vsab Csa Pic Rsv Rlv Pvb Rnet ABP Rla re...

5 days ago | 0

| accepted

Answered

System of 2 differential equations

The code you posted has errors, specifically unbalanced parentheses. I edited your equations to correct this, however I am not ...

System of 2 differential equations

The code you posted has errors, specifically unbalanced parentheses. I edited your equations to correct this, however I am not ...

5 days ago | 0

Answered

How can I decrease the running time of this code?

Use the diff (link) function: Ux = diff(X); Uy = diff(Y); Uz = diff(Z); When I timed your code and diff with these matrices...

How can I decrease the running time of this code?

Use the diff (link) function: Ux = diff(X); Uy = diff(Y); Uz = diff(Z); When I timed your code and diff with these matrices...

5 days ago | 0

Answered

Is there a way to plot everything together using the surf command in matlab?

Use the hold function, and plot the surfaces in a loop. Try this: figure hold all for k1 = 1:size(N_diesel,3) surf(R...

Is there a way to plot everything together using the surf command in matlab?

Use the hold function, and plot the surfaces in a loop. Try this: figure hold all for k1 = 1:size(N_diesel,3) surf(R...

5 days ago | 1

| accepted

Answered

Please Help Me Simple Question

Try this: digprice = @(depth) 6 + ceil(fix((depth+1)))*4; % Digging Price As A Function Of Depth dep = lins...

Please Help Me Simple Question

Try this: digprice = @(depth) 6 + ceil(fix((depth+1)))*4; % Digging Price As A Function Of Depth dep = lins...

5 days ago | 0