Answered

Keeping values of function when solving ODE

As your ODE is written above we have to ask: Why bother? y is deterministically given provided your input parameters and the tim...

Keeping values of function when solving ODE

As your ODE is written above we have to ask: Why bother? y is deterministically given provided your input parameters and the tim...

16 minutes ago | 0

Answered

Deconvolution of a combination of Gaussians signal

If you have a signal that is smeared or convolved with some point-spread-function you can to some extent undo that by using eith...

Deconvolution of a combination of Gaussians signal

If you have a signal that is smeared or convolved with some point-spread-function you can to some extent undo that by using eith...

1 hour ago | 0

Answered

How to solve the second-oder differential equations with two variables using ODE45 or whatever

To the best of my "reading-ability" you seem to have it right in ODE-defining function. From your equations I expect them to be ...

How to solve the second-oder differential equations with two variables using ODE45 or whatever

To the best of my "reading-ability" you seem to have it right in ODE-defining function. From your equations I expect them to be ...

2 days ago | 0

Answered

Best guess/optimization solution needed

From the information you've given this sounds like a "reasonably" straightforward optimization-problem. You could try something ...

Best guess/optimization solution needed

From the information you've given this sounds like a "reasonably" straightforward optimization-problem. You could try something ...

6 days ago | 0

Answered

How to solve differential equations involving matrices?

Based off of your description I see no difference betwee solving these 4 x 4 coupled ODEs and solving them as 16 x 1 coupled ODE...

How to solve differential equations involving matrices?

Based off of your description I see no difference betwee solving these 4 x 4 coupled ODEs and solving them as 16 x 1 coupled ODE...

8 days ago | 0

Answered

Remove temporal intensity changes in image series

I'd try something like this: ImFiles = dir('*.png'); % well you have your images somehow... roi_c = [11 37 17 51]; for iIm = ...

Remove temporal intensity changes in image series

I'd try something like this: ImFiles = dir('*.png'); % well you have your images somehow... roi_c = [11 37 17 51]; for iIm = ...

13 days ago | 0

Answered

Solving coupled ODEBVP using MATLAB

There's an old "proverb" going something like "when in danger when in doubt run around in circles scream and shoot". I vaguely ...

Solving coupled ODEBVP using MATLAB

There's an old "proverb" going something like "when in danger when in doubt run around in circles scream and shoot". I vaguely ...

13 days ago | 0

| accepted

Answered

What MATLAB functions are underappreciated?

Just a couple of basic ones: lscov - linear regression when there is a data-covariance-matrix svd (to use together with Tikhon...

What MATLAB functions are underappreciated?

Just a couple of basic ones: lscov - linear regression when there is a data-covariance-matrix svd (to use together with Tikhon...

14 days ago | 0

Answered

Getting two components for one frequency in FFT

The fft is a circular Fourier transform, there will always be some spectral leakage from frequencies that are not exactly period...

Getting two components for one frequency in FFT

The fft is a circular Fourier transform, there will always be some spectral leakage from frequencies that are not exactly period...

15 days ago | 1

| accepted

Answered

Local macro in STATA?

That is generally a poor programming pattern (read this as: "This is a really poor idea!"). You should aim to write your code su...

Local macro in STATA?

That is generally a poor programming pattern (read this as: "This is a really poor idea!"). You should aim to write your code su...

16 days ago | 0

Answered

function for addition 2^16 modulo

Just make sure that your ints a and b are in int32 or larger number of bit-formats, then use: C = mod(a+b,2^16) HTH

function for addition 2^16 modulo

Just make sure that your ints a and b are in int32 or larger number of bit-formats, then use: C = mod(a+b,2^16) HTH

17 days ago | 1

Answered

how do I classify image based on smoothness and high frequency?

For measure of smoothness I'd go with something like this: d2I = del2(I); % laplacian of your image (grayscale, double). From ...

how do I classify image based on smoothness and high frequency?

For measure of smoothness I'd go with something like this: d2I = del2(I); % laplacian of your image (grayscale, double). From ...

17 days ago | 0

Answered

Horizontal First Differencer on a Matrix

Have a look on the help and documentation to diff. For this case use: y = diff(x,[],2); % or explicitly 1st difference: y = d...

Horizontal First Differencer on a Matrix

Have a look on the help and documentation to diff. For this case use: y = diff(x,[],2); % or explicitly 1st difference: y = d...

18 days ago | 0

| accepted

Answered

How to remove space between subplots of heatmaps?

If you use the axes-handle output from subplot you can then set any of their properties as you desire: sph = subplot(3,1,1); %...

How to remove space between subplots of heatmaps?

If you use the axes-handle output from subplot you can then set any of their properties as you desire: sph = subplot(3,1,1); %...

18 days ago | 0

Answered

If a structure exists in a file

You can explicitly check for the existense of a variable in a .mat-file: qwe = whos('-file','your-filename.mat','cDA_External_S...

If a structure exists in a file

You can explicitly check for the existense of a variable in a .mat-file: qwe = whos('-file','your-filename.mat','cDA_External_S...

19 days ago | 0

| accepted

Answered

help debugging 3-D plot code

You have to get your equations for x, y and z right: x = a*cos(phi).*sin(theta); y = b*sin(phi).*sin(theta); z = b*cos(theta)...

help debugging 3-D plot code

You have to get your equations for x, y and z right: x = a*cos(phi).*sin(theta); y = b*sin(phi).*sin(theta); z = b*cos(theta)...

19 days ago | 1

| accepted

Answered

Combined mean monthly values from 24 years of monthly data

Something like this perhaps: BV = table2array(baseline_values); clf subplot(2,1,1) imagesc(reshape(BV(:,4),12,[])') % Illust...

Combined mean monthly values from 24 years of monthly data

Something like this perhaps: BV = table2array(baseline_values); clf subplot(2,1,1) imagesc(reshape(BV(:,4),12,[])') % Illust...

19 days ago | 0

Answered

Plotting negative values on an histogram

It seems likely that you've mixed up BinCounts and BinEdges - it doesn't make much sense to have a negative number of something ...

Plotting negative values on an histogram

It seems likely that you've mixed up BinCounts and BinEdges - it doesn't make much sense to have a negative number of something ...

19 days ago | 0

Answered

M-point averaging filter to an image

Read the help and documentation for conv2. HTH

M-point averaging filter to an image

Read the help and documentation for conv2. HTH

19 days ago | 0

Answered

Why doesn't the ode15s solver work when I switch 'k1q','k2q','k12q' from a single value into vectors(more values)?

When k1q is an array you will get an error when you try to assign the product of that array with the scalar C(1) to dCdt(1) whic...

Why doesn't the ode15s solver work when I switch 'k1q','k2q','k12q' from a single value into vectors(more values)?

When k1q is an array you will get an error when you try to assign the product of that array with the scalar C(1) to dCdt(1) whic...

20 days ago | 1

| accepted

Answered

i am getting error in line 18 of invalid use of operator.please help me solving this

OK, so you want to solve 3 coupled equations of motion for some harmonically varying solution. First you have to understand the ...

i am getting error in line 18 of invalid use of operator.please help me solving this

OK, so you want to solve 3 coupled equations of motion for some harmonically varying solution. First you have to understand the ...

21 days ago | 0

Answered

make a better map

You should try: shading flat instead of the interp option. You will have to accept the fact that you only have data in a 32-by...

make a better map

You should try: shading flat instead of the interp option. You will have to accept the fact that you only have data in a 32-by...

21 days ago | 0

| accepted

Answered

Solving differential equations to get accurate plot as shown.

Since you get an oscillatory behaviour of (primarily) Cecm and Crec it is very likely that you have a bug for some of the reacti...

Solving differential equations to get accurate plot as shown.

Since you get an oscillatory behaviour of (primarily) Cecm and Crec it is very likely that you have a bug for some of the reacti...

21 days ago | 0

Answered

How to use chebop function?

Have you installed the chebfun package? Have you added the chebfun install directory to the matlab-path? If you have it install...

How to use chebop function?

Have you installed the chebfun package? Have you added the chebfun install directory to the matlab-path? If you have it install...

22 days ago | 0

| accepted

Answered

Improving speed of readtable

It is a rather large data-file to read. You might reduce the read-time if you use load instead of readtable - that should reduce...

Improving speed of readtable

It is a rather large data-file to read. You might reduce the read-time if you use load instead of readtable - that should reduce...

22 days ago | 0

Answered

How to create and plot an oloid in MATLAB

Have a look at the help and documentation of the convhull function. That should give you a solution for this task - in the sense...

How to create and plot an oloid in MATLAB

Have a look at the help and documentation of the convhull function. That should give you a solution for this task - in the sense...

22 days ago | 0

Answered

Multidimensional integration in matlab

Have a look at the help and documentation for integral2. That should be the function to do 2-D integrals, that sounds like the f...

Multidimensional integration in matlab

Have a look at the help and documentation for integral2. That should be the function to do 2-D integrals, that sounds like the f...

23 days ago | 1

| accepted

Answered

Why does version R2020b gives errors when running functions such as fmincon, when version R2019a runs properly.

Have you installed the optimization toolbox in your 2020b install? If not that is where that function resides. Check the existe...

Why does version R2020b gives errors when running functions such as fmincon, when version R2019a runs properly.

Have you installed the optimization toolbox in your 2020b install? If not that is where that function resides. Check the existe...

23 days ago | 0

| accepted

Answered

Simulation of Shepp Logan phaton dataset

The phantom-function is a standard .m-function available in source-code, so you can read it clean and plain. It is simply a func...

Simulation of Shepp Logan phaton dataset

The phantom-function is a standard .m-function available in source-code, so you can read it clean and plain. It is simply a func...

24 days ago | 2

Answered

Different line types for multiple curves

Maybe you'll have to accept looping a little: lstl = {'-','--'}; for i1 = 1:4, set(p(i1),'linestyle',lstl{rem(i1,2)+1}) en...

Different line types for multiple curves

Maybe you'll have to accept looping a little: lstl = {'-','--'}; for i1 = 1:4, set(p(i1),'linestyle',lstl{rem(i1,2)+1}) en...

27 days ago | 0

| accepted