12.436 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

unique values inside a matrix

Try this: A = [1 30 1 20 1 20 1 20 2 30 2 28 2 28]; Out = unique(A, 'rows', 'sta...

unique values inside a matrix

Try this: A = [1 30 1 20 1 20 1 20 2 30 2 28 2 28]; Out = unique(A, 'rows', 'sta...

alrededor de 9 horas ago | 1

| accepted

Answered

Plotting one curve with two colors

Try this: dnv = datenum({'15.01.2018','14.10.2018','15.10.2018','15.07.2019'}, 'dd.mm.yyyy'); % Limits dn = dnv(1):dnv(end); ...

Plotting one curve with two colors

Try this: dnv = datenum({'15.01.2018','14.10.2018','15.10.2018','15.07.2019'}, 'dd.mm.yyyy'); % Limits dn = dnv(1):dnv(end); ...

1 día ago | 1

| accepted

Answered

Apply function on array

Try this: A = randi(9, 10, 1) % Create ‘A’ F = zeros(size(A)); ...

Apply function on array

Try this: A = randi(9, 10, 1) % Create ‘A’ F = zeros(size(A)); ...

1 día ago | 0

Answered

Plot : how can I use datestr on a matrix?

To get date strings on a plot that uses datenum numbers, use the datetick function.

Plot : how can I use datestr on a matrix?

To get date strings on a plot that uses datenum numbers, use the datetick function.

1 día ago | 1

| accepted

Answered

Problem solving a non linear equation using fsolve

If you first vectorise your function: eqn = @(Vcp) -2.*Vcp + ((Vo./(2.*n)) +Vcp) .* (1+ sqrt(1-(Iin*Zr./((Vo/(2*n))+Vcp)).^2)...

Problem solving a non linear equation using fsolve

If you first vectorise your function: eqn = @(Vcp) -2.*Vcp + ((Vo./(2.*n)) +Vcp) .* (1+ sqrt(1-(Iin*Zr./((Vo/(2*n))+Vcp)).^2)...

1 día ago | 1

| accepted

Answered

How can I use fprintf to print an mxn matrix of values to a file

There are a numberr of ways to write your matrix, depending on what you want to do. Since you want to use fprintf, if ‘M’ is ...

How can I use fprintf to print an mxn matrix of values to a file

There are a numberr of ways to write your matrix, depending on what you want to do. Since you want to use fprintf, if ‘M’ is ...

3 días ago | 2

| accepted

Answered

How to generate -1, 0 and 1?

I am not certain what result you want. One option is the sign function: A = [ -0.6286 -0.8418 0.0710 1.0000 0.2...

How to generate -1, 0 and 1?

I am not certain what result you want. One option is the sign function: A = [ -0.6286 -0.8418 0.0710 1.0000 0.2...

3 días ago | 0

| accepted

Answered

how to generate random number from a given Normal distribution

There are several options. One is the core MATLAB function randn. The Statistics and Machine Learning Toolbox has the normrnd ...

how to generate random number from a given Normal distribution

There are several options. One is the core MATLAB function randn. The Statistics and Machine Learning Toolbox has the normrnd ...

3 días ago | 0

| accepted

Answered

Optimizing parameters in ODE

This is a simple, separable differential equation that you can likely solve by hand. Using the Symbolic Math Toolbox: syms ...

Optimizing parameters in ODE

This is a simple, separable differential equation that you can likely solve by hand. Using the Symbolic Math Toolbox: syms ...

4 días ago | 0

Answered

add label to a contour when when multiples plots

They appear to be plotted on the same set of coordinate matrices. One option is to use different line colours (and other variat...

add label to a contour when when multiples plots

They appear to be plotted on the same set of coordinate matrices. One option is to use different line colours (and other variat...

4 días ago | 1

| accepted

Answered

How to use format spec to read in Textscan?

I doubt you can insert the ‘e’ as part of the data. One option: x = sscanf('-2.554-4','%f') y = x(1).*10^x(2) producing: ...

How to use format spec to read in Textscan?

I doubt you can insert the ‘e’ as part of the data. One option: x = sscanf('-2.554-4','%f') y = x(1).*10^x(2) producing: ...

4 días ago | 0

| accepted

Answered

I'm not getting table

It works when I run it, and with: q = which('table.txt', '-all') type(q{:}) produces: t x(1) x(2) ----...

I'm not getting table

It works when I run it, and with: q = which('table.txt', '-all') type(q{:}) produces: t x(1) x(2) ----...

4 días ago | 0

Answered

Put title for each subplot

Remove the single quotes: title (Titleindex(i)); and spell the name correctly in both the variable and references to it!

Put title for each subplot

Remove the single quotes: title (Titleindex(i)); and spell the name correctly in both the variable and references to it!

4 días ago | 1

| accepted

Answered

str2num not working on array

It returns an empty array because you apparently ask for a character array (for example ‘Red’) as the first input. That is not ...

str2num not working on array

It returns an empty array because you apparently ask for a character array (for example ‘Red’) as the first input. That is not ...

4 días ago | 0

Answered

Difference between two plots of this final output figure??

The system being modeled Simulate Response to Square Wave is a 1-input, 2=output (SIMO) system, presenting the same input to bot...

Difference between two plots of this final output figure??

The system being modeled Simulate Response to Square Wave is a 1-input, 2=output (SIMO) system, presenting the same input to bot...

4 días ago | 1

| accepted

Answered

Related to calculate average within particular range of graph

Use the negative of your signal (essentially flipping it upside-down) so the sharp dips are now peaks. Then use either findpeak...

Related to calculate average within particular range of graph

Use the negative of your signal (essentially flipping it upside-down) so the sharp dips are now peaks. Then use either findpeak...

4 días ago | 0

| accepted

Answered

problem in taking the step response of a function

Your ‘ matrix’ is actually a scalar: -0.022, that will evaluate to in your state space realisation. This produces a typical de...

problem in taking the step response of a function

Your ‘ matrix’ is actually a scalar: -0.022, that will evaluate to in your state space realisation. This produces a typical de...

4 días ago | 0

Answered

How to solve a differential equation using data from experiment?

Since you are not integrating the differential equation, this is a simple nonilinear parameter estimation problem. Try this: ...

How to solve a differential equation using data from experiment?

Since you are not integrating the differential equation, this is a simple nonilinear parameter estimation problem. Try this: ...

5 días ago | 0

Answered

How a solution depends on a variable

One approach: gammav = linspace(0.5, 1, 10); for k = 1:numel(gammav) UE{k} = Explicit(S,sigma,r,T,M,K,gammav(k),N); end...

How a solution depends on a variable

One approach: gammav = linspace(0.5, 1, 10); for k = 1:numel(gammav) UE{k} = Explicit(S,sigma,r,T,M,K,gammav(k),N); end...

5 días ago | 0

| accepted

Answered

Normalize by using zero mean and unit variance

If you have R2018a or later, use the normalize function. Another option is zscore.

Normalize by using zero mean and unit variance

If you have R2018a or later, use the normalize function. Another option is zscore.

5 días ago | 1

| accepted

Answered

I have data points for different x and y points in excel and am trying to create a 3D contour plot of this data

I have absolutely no idea what you want. Try this: D = xlsread('excel for aerolab3.xlsx'); y1 = D(2:12, 2:end); y2 = D(16...

I have data points for different x and y points in excel and am trying to create a 3D contour plot of this data

I have absolutely no idea what you want. Try this: D = xlsread('excel for aerolab3.xlsx'); y1 = D(2:12, 2:end); y2 = D(16...

5 días ago | 0

| accepted

Answered

Shifting Baselines of Raman Spectra

This is an interesting problem! It took me a while to figure out the correct approach, however it is deceptively simple, and ...

Shifting Baselines of Raman Spectra

This is an interesting problem! It took me a while to figure out the correct approach, however it is deceptively simple, and ...

5 días ago | 0

| accepted

Answered

How can I interpolate data with the function ScatteredInterpolant (or else) within the boundaries of the input data only?

Specify 'ExtrapolationMethod' as 'none'.

How can I interpolate data with the function ScatteredInterpolant (or else) within the boundaries of the input data only?

Specify 'ExtrapolationMethod' as 'none'.

5 días ago | 0

| accepted

Answered

Creating a vector out of variables

Use the format function to change the way they are displayed: A = 1/(10^(-6)); B = 22^(1/4); C = 4^(3+2); format long E ...

Creating a vector out of variables

Use the format function to change the way they are displayed: A = 1/(10^(-6)); B = 22^(1/4); C = 4^(3+2); format long E ...

5 días ago | 0

| accepted

Answered

Remove NaN inside a loop cycle

Try this: B(i,:) = X(i,~isnan(X(i,:)));

Remove NaN inside a loop cycle

Try this: B(i,:) = X(i,~isnan(X(i,:)));

6 días ago | 0

| accepted

Answered

ODE45 wont run, just says "error"?

You have two problems: First, your system has two differential equations, so you must have two initial conditions: ic = [0 1...

ODE45 wont run, just says "error"?

You have two problems: First, your system has two differential equations, so you must have two initial conditions: ic = [0 1...

6 días ago | 0

| accepted

Answered

Plot for specific vibrational heat

Use element-wise operations: C_vv=((R*theta_v^2*(exp(theta_v./T)))./(((exp(theta_v./T))-1).^2.*T.^2)); ...

Plot for specific vibrational heat

Use element-wise operations: C_vv=((R*theta_v^2*(exp(theta_v./T)))./(((exp(theta_v./T))-1).^2.*T.^2)); ...

6 días ago | 0

| accepted

Answered

Optimisation of a filter knowing input and output

The System identification Toolbox is dedicated to problems like this. See if the Signal Processing Toolbox invfreqz function ...

Optimisation of a filter knowing input and output

The System identification Toolbox is dedicated to problems like this. See if the Signal Processing Toolbox invfreqz function ...

6 días ago | 0

Answered

How can I separate the two fprintf

Add a ‘\n’ newline character to the end of each line: fprintf('A new location was found.Enter an ID for it:''NE051\n'); ...

How can I separate the two fprintf

Add a ‘\n’ newline character to the end of each line: fprintf('A new location was found.Enter an ID for it:''NE051\n'); ...

7 días ago | 0

| accepted