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

We need to install Global Optimization Tool

Try running these lines from a script or your Command Window first: restoredefaultpath rehash toolboxcache That may fix th...

We need to install Global Optimization Tool

Try running these lines from a script or your Command Window first: restoredefaultpath rehash toolboxcache That may fix th...

1 hour ago | 0

Answered

convert plot3 to contour plot

Use the griddata function: a = randi(9, 10, 3); x = a(:,1); y = a(:,2); z = a(:,3); xv = linspace(min(x), max(x), 6); ...

convert plot3 to contour plot

Use the griddata function: a = randi(9, 10, 3); x = a(:,1); y = a(:,2); z = a(:,3); xv = linspace(min(x), max(x), 6); ...

2 hours ago | 0

Answered

Index exceeds matrix dimensions error "for my code"

It is unfortunate that we do not get the opportunity to see what ‘X’ is for the various files, nor anything else about them. ...

Index exceeds matrix dimensions error "for my code"

It is unfortunate that we do not get the opportunity to see what ‘X’ is for the various files, nor anything else about them. ...

11 hours ago | 0

Answered

this is a part of my test and i cant find the mistake in this .

The obvious observation is that ‘x’ is going to be less than 10 from the initial iteration through how many iterations it takes ...

this is a part of my test and i cant find the mistake in this .

The obvious observation is that ‘x’ is going to be less than 10 from the initial iteration through how many iterations it takes ...

13 hours ago | 0

| accepted

Answered

Error in saveas, Invalid figure handle

I cannot run your code because I do not have the necessary files. However: %% Let's plot T and RH times...

Error in saveas, Invalid figure handle

I cannot run your code because I do not have the necessary files. However: %% Let's plot T and RH times...

16 hours ago | 0

Answered

Custom colour bar, excluding the Blue from RGB.

Define ‘CustomColourMap’ as: CustomColourMap = @(x) [linspace(0,1,x).' linspace(1,0,x).' zeros(x,1)]; then to use it: Cust...

Custom colour bar, excluding the Blue from RGB.

Define ‘CustomColourMap’ as: CustomColourMap = @(x) [linspace(0,1,x).' linspace(1,0,x).' zeros(x,1)]; then to use it: Cust...

17 hours ago | 0

Answered

how to make fuction from changing varibles

That is relatively straightforward to do with ndgrid or meshgrid. Try this hypothetical example: Z = @(x,y,z) x.^2 + y.^2 +...

how to make fuction from changing varibles

That is relatively straightforward to do with ndgrid or meshgrid. Try this hypothetical example: Z = @(x,y,z) x.^2 + y.^2 +...

20 hours ago | 0

Answered

Add 0.5 *0.5 degree grid on figure (country)

This illustrates the general approach: x = linspace(44, 64); y = linspace(25, 40); t = linspace(0,2*pi); circx = 0.25*(ma...

Add 0.5 *0.5 degree grid on figure (country)

This illustrates the general approach: x = linspace(44, 64); y = linspace(25, 40); t = linspace(0,2*pi); circx = 0.25*(ma...

21 hours ago | 0

| accepted

Answered

How can i plot with if statement ?

Try this: x=[10 20 30 40 50 ] ; for k = 1:numel(x) if x(k)==10 y(k)=((10*10^6)*.1523)./ x(k) ; end if...

How can i plot with if statement ?

Try this: x=[10 20 30 40 50 ] ; for k = 1:numel(x) if x(k)==10 y(k)=((10*10^6)*.1523)./ x(k) ; end if...

22 hours ago | 0

Answered

Make a Plot using loop

Subscript ‘Cp’ and the plot magically appears! Dg=150; %mg Vd=50; %L Ke=0.4; %h^-1 Ka=1.6; %h^-1 t=0:0.1:10; for k = 1...

Make a Plot using loop

Subscript ‘Cp’ and the plot magically appears! Dg=150; %mg Vd=50; %L Ke=0.4; %h^-1 Ka=1.6; %h^-1 t=0:0.1:10; for k = 1...

24 hours ago | 0

| accepted

Answered

titel for tables with spce between the words

The R2019b release allows spaces and other (inluuding Unicode) characters in table variable names. Upgrade to it and you will b...

titel for tables with spce between the words

The R2019b release allows spaces and other (inluuding Unicode) characters in table variable names. Upgrade to it and you will b...

24 hours ago | 1

Answered

How to change the size of error bar?

I am not certain what you want. Try this: errs = rand(1,10); x = 1:10; y = randi([10 20],1,10); figure plot(x, y) ho...

How to change the size of error bar?

I am not certain what you want. Try this: errs = rand(1,10); x = 1:10; y = randi([10 20],1,10); figure plot(x, y) ho...

1 day ago | 0

Answered

Ending a recursive function

I have not run your posted code, however two things are immediately apoparent. First, in the calls to ‘mysequence’, the fun...

Ending a recursive function

I have not run your posted code, however two things are immediately apoparent. First, in the calls to ‘mysequence’, the fun...

1 day ago | 0

Answered

Relational operator == doesn't work properly in some cases!

You are seeing the effects of floating-point approximation error. See for example: Why is 0.3 - 0.2 - 0.1 (or similar) not e...

Relational operator == doesn't work properly in some cases!

You are seeing the effects of floating-point approximation error. See for example: Why is 0.3 - 0.2 - 0.1 (or similar) not e...

1 day ago | 0

| accepted

Answered

C.T. signals convolution in Matlab

One approach: syms h(t) x(t) s t Fcn1 = h(t) == exp(-2*t)*4 - 4*exp(-t); Fcn2 = x(t) == heaviside(t); convlap = laplace(Fc...

C.T. signals convolution in Matlab

One approach: syms h(t) x(t) s t Fcn1 = h(t) == exp(-2*t)*4 - 4*exp(-t); Fcn2 = x(t) == heaviside(t); convlap = laplace(Fc...

2 days ago | 0

| accepted

Answered

how can i Solve this equation With ode45

Try this: syms y(t) w T Y DE = diff(y,2) + w; [VF,Subs] = odeToVectorField(DE) ODEfcn = matlabFunction(VF, 'Vars',{T,Y,w})...

how can i Solve this equation With ode45

Try this: syms y(t) w T Y DE = diff(y,2) + w; [VF,Subs] = odeToVectorField(DE) ODEfcn = matlabFunction(VF, 'Vars',{T,Y,w})...

2 days ago | 0

Answered

Problem using function fsolve

Use a different initial parameter estimate vector. Try this: z0 = rand(3,1); Your code divides the parameters by each othe...

Problem using function fsolve

Use a different initial parameter estimate vector. Try this: z0 = rand(3,1); Your code divides the parameters by each othe...

2 days ago | 0

| accepted

Answered

Creating a 3d plot of the solutions to an ODE as the time a switch condition activates varies

I am not certain what you want to do. Try this: function L2_ode45 tspan = linspace(0, 500, 50); t1 = 100:100:500;...

Creating a 3d plot of the solutions to an ODE as the time a switch condition activates varies

I am not certain what you want to do. Try this: function L2_ode45 tspan = linspace(0, 500, 50); t1 = 100:100:500;...

2 days ago | 1

| accepted

Answered

Replacing NaN with last real value

If you have R2016b or later releases, use the fillmissing function. I am not certain what you want to do, so see the method a...

Replacing NaN with last real value

If you have R2016b or later releases, use the fillmissing function. I am not certain what you want to do, so see the method a...

2 days ago | 0

| accepted

Answered

Peak value on plot graph

If you have R2017b or later, you can use the islocalmax function. If you have the Signal Processing Toolbox, you can use the ...

Peak value on plot graph

If you have R2017b or later, you can use the islocalmax function. If you have the Signal Processing Toolbox, you can use the ...

2 days ago | 0

| accepted

Answered

Finding the percentage of NaN cells in columns

This does everything for all the tables in ‘C’: D = load('C.mat'); C = D.C; for k = 1:numel(C) C{k}(:,1:4) = fillmissin...

Finding the percentage of NaN cells in columns

This does everything for all the tables in ‘C’: D = load('C.mat'); C = D.C; for k = 1:numel(C) C{k}(:,1:4) = fillmissin...

2 days ago | 1

| accepted

Answered

Import correct date and time from different columns in Excel

Try this: In = readtable('Airport 2019 (1.5-30.9).xlsx', 'PreserveVariableNames',1); hrmnsc = datetime(compose('%04d\n',In.Ti...

Import correct date and time from different columns in Excel

Try this: In = readtable('Airport 2019 (1.5-30.9).xlsx', 'PreserveVariableNames',1); hrmnsc = datetime(compose('%04d\n',In.Ti...

3 days ago | 0

| accepted

Answered

where are my data?

Try this: F = openfig('untitled.fig'); ax = gca; lines = findobj(ax, 'Type','Line'); for k = 1:numel(lines) x{k,:} = l...

where are my data?

Try this: F = openfig('untitled.fig'); ax = gca; lines = findobj(ax, 'Type','Line'); for k = 1:numel(lines) x{k,:} = l...

3 days ago | 1

| accepted

Answered

ODE45 Unable to perform assignment because the left and right sides have a different number of element

The problem is ‘G’. Since it is a vector, all computations involving it are going to be arrays. You can use it, however in e...

ODE45 Unable to perform assignment because the left and right sides have a different number of element

The problem is ‘G’. Since it is a vector, all computations involving it are going to be arrays. You can use it, however in e...

3 days ago | 0

Answered

Solve system of differential equations with vector input

In the derivation, let ‘a’ simply be an undefined constant, and define the initial conditions as 0 (unless you want them to be s...

Solve system of differential equations with vector input

In the derivation, let ‘a’ simply be an undefined constant, and define the initial conditions as 0 (unless you want them to be s...

3 days ago | 0

| accepted

Answered

Problem with if statement

You almost answered your own Question! See if the any function will do what you want.

Problem with if statement

You almost answered your own Question! See if the any function will do what you want.

3 days ago | 0

Answered

Is it possible to extract also R^2 value from linear fit between 2 vectors ?

It is, however polyfit wil not do it for you. Try this: x = 1:10; % Create ‘x’ y = r...

Is it possible to extract also R^2 value from linear fit between 2 vectors ?

It is, however polyfit wil not do it for you. Try this: x = 1:10; % Create ‘x’ y = r...

3 days ago | 1

Answered

add the peak values of a signal to a graph regardless of number of peaks

Your code is a bit difficult to follow. Insert this text call just after the plot call for the red circles: text(picos(:,1)...

add the peak values of a signal to a graph regardless of number of peaks

Your code is a bit difficult to follow. Insert this text call just after the plot call for the red circles: text(picos(:,1)...

3 days ago | 0

Answered

Error using integral function

Try this instead: ALP = @(j,l,x) ((-1)^l)*(1-x*x)^(l/2)*diff(legendreP(j,x),l); syms x y alpha = 45*pi/180; b = cos(alpha);...

Error using integral function

Try this instead: ALP = @(j,l,x) ((-1)^l)*(1-x*x)^(l/2)*diff(legendreP(j,x),l); syms x y alpha = 45*pi/180; b = cos(alpha);...

3 days ago | 0

| accepted

Answered

frequeny domain signal into time domain signal

The ‘outputtransmitterADS.txt’ file has dB as a function of frequency. There are two problems: First: The frequency goes f...

frequeny domain signal into time domain signal

The ‘outputtransmitterADS.txt’ file has dB as a function of frequency. There are two problems: First: The frequency goes f...

3 days ago | 0