Answered

ODE to solve for density

Your ODE is not correct for the pressure-variation. What you have in the p_prime function is closer to the solution of the press...

ODE to solve for density

Your ODE is not correct for the pressure-variation. What you have in the p_prime function is closer to the solution of the press...

alrededor de 14 horas ago | 1

Answered

How to find total derivative by using total derivative operator?

If you have the symbolic toolbox it is just to get to work: syms x y t syms u(x,y,t) syms p(x,y,t) dudx = diff(u*p,x) % etc....

How to find total derivative by using total derivative operator?

If you have the symbolic toolbox it is just to get to work: syms x y t syms u(x,y,t) syms p(x,y,t) dudx = diff(u*p,x) % etc....

alrededor de 22 horas ago | 0

Answered

How to fit a multi modal distribution using a weighted sum of PDFs?

You don't have enough samples to confidently claim you have a multimodal distribution. If you simply try this with fitting expon...

How to fit a multi modal distribution using a weighted sum of PDFs?

You don't have enough samples to confidently claim you have a multimodal distribution. If you simply try this with fitting expon...

alrededor de 22 horas ago | 0

| accepted

Answered

Entropy values of all the bands in a given hyperspectral image.

It seems it is not the most robust functionality, If I run the test of entropy from the help of the entropy-function I get rathe...

Entropy values of all the bands in a given hyperspectral image.

It seems it is not the most robust functionality, If I run the test of entropy from the help of the entropy-function I get rathe...

2 días ago | 0

| accepted

Answered

How to solve a non linear ovedetermined system of equations??

You can always try with regular minimization. Perhaps something like this: function err = err_1(pars,x,y,z,y) c = 3; % guess, ...

How to solve a non linear ovedetermined system of equations??

You can always try with regular minimization. Perhaps something like this: function err = err_1(pars,x,y,z,y) c = 3; % guess, ...

2 días ago | 0

| accepted

Answered

Error: Array indices must be positive integers or logical values.

Matlab has the convention that arrays-indexes starts from 1. Arrays have to be indexed with integers. You can solve your proble...

Error: Array indices must be positive integers or logical values.

Matlab has the convention that arrays-indexes starts from 1. Arrays have to be indexed with integers. You can solve your proble...

2 días ago | 0

Answered

How to do exponential curve fitting like y=a.* log(x + b.*exp(c.*x)

You can do something like this: mod_fcn = @(b,x) b(1).*(log(x + (b(2).*exp(b(3).*x)))); % Objective Function err_fcn = @(b...

How to do exponential curve fitting like y=a.* log(x + b.*exp(c.*x)

You can do something like this: mod_fcn = @(b,x) b(1).*(log(x + (b(2).*exp(b(3).*x)))); % Objective Function err_fcn = @(b...

4 días ago | 0

| accepted

Answered

How to do this with Delaunay Triangulation?

You'll have to go through DT.ConnectivityList and remove the triangles you don't like. The function returns a convex set of tria...

How to do this with Delaunay Triangulation?

You'll have to go through DT.ConnectivityList and remove the triangles you don't like. The function returns a convex set of tria...

5 días ago | 0

Answered

unable to solve non linear differential equation

This looks like an equation of the form: Unless you have an equation for a trajectory of a spinning object falling in gravity...

unable to solve non linear differential equation

This looks like an equation of the form: Unless you have an equation for a trajectory of a spinning object falling in gravity...

5 días ago | 0

Answered

Solving system of ODEs with ode45 and multiple time dependent variables

In your ODE-fun you can "simply" interpolate your time-dependent coefficients. Something like this: function dTdt = ODEfun(t,T,...

Solving system of ODEs with ode45 and multiple time dependent variables

In your ODE-fun you can "simply" interpolate your time-dependent coefficients. Something like this: function dTdt = ODEfun(t,T,...

5 días ago | 1

| accepted

Answered

How to make a matrix of all zeros be the same size as a data set being used?

Something like this: u = zeros(size(v)); HTH

How to make a matrix of all zeros be the same size as a data set being used?

Something like this: u = zeros(size(v)); HTH

5 días ago | 1

| accepted

Answered

Constrained optimization, free code

There ought to be some optimization-tools on the file-exchange that can be used instead of fminsearch. Perhaps the minimize tool...

Constrained optimization, free code

There ought to be some optimization-tools on the file-exchange that can be used instead of fminsearch. Perhaps the minimize tool...

6 días ago | 0

Answered

2D DFT of an image

OK, here's a solution that's computationally useless since 1965: szIm = size(Im); M1 = dftmtx(szIm(1)); M2 = dftmtx(szIm(2));...

2D DFT of an image

OK, here's a solution that's computationally useless since 1965: szIm = size(Im); M1 = dftmtx(szIm(1)); M2 = dftmtx(szIm(2));...

6 días ago | 0

Answered

Why is Matlab changing thickness of the line in this plot ?

input4 and input5 have circle and triangle set as marker. I can't see where that happens, but try to un-set that. Something like...

Why is Matlab changing thickness of the line in this plot ?

input4 and input5 have circle and triangle set as marker. I can't see where that happens, but try to un-set that. Something like...

6 días ago | 0

| accepted

Answered

Eigen Vectors and Values using Matlab

Why not calculating the eigenvectors at once? [Ev,lambda]=eig(A) Also, when rounding the eigenvalues, you're no longer guarant...

Eigen Vectors and Values using Matlab

Why not calculating the eigenvectors at once? [Ev,lambda]=eig(A) Also, when rounding the eigenvalues, you're no longer guarant...

6 días ago | 1

Answered

Diagonal Interpolation/Extrapolation of a 1024 x 30 Matrix

What you can try for this is to align the main peaks, using something like this: [~,idxPeaks] = max(I_spectras,[],2); % Here I ...

Diagonal Interpolation/Extrapolation of a 1024 x 30 Matrix

What you can try for this is to align the main peaks, using something like this: [~,idxPeaks] = max(I_spectras,[],2); % Here I ...

6 días ago | 0

Answered

Converting Linear Equations to Matrix Form

Is k some sort of propagation (time? space?) index and you want to convert these equations into a matrix-format, or are these ac...

Converting Linear Equations to Matrix Form

Is k some sort of propagation (time? space?) index and you want to convert these equations into a matrix-format, or are these ac...

7 días ago | 0

Answered

Save multiple image automatically

You simply have to generate a sequence of unique filenames to save to. Something like this: outfile = fullfile(outfolder, s...

Save multiple image automatically

You simply have to generate a sequence of unique filenames to save to. Something like this: outfile = fullfile(outfolder, s...

7 días ago | 0

| accepted

Answered

Cell to mat conversion

If you want to extract the content of one cell simply do: b = a{1}; If you want to merge a couple of cells into an array or ma...

Cell to mat conversion

If you want to extract the content of one cell simply do: b = a{1}; If you want to merge a couple of cells into an array or ma...

7 días ago | 0

| accepted

Answered

interp2 error non monotonus

It should (big claim, I know) be as simple as: torque = data(2:end,1); rpm = data(1,2:end); eff_epk = data(2:end,2:end); Nm ...

interp2 error non monotonus

It should (big claim, I know) be as simple as: torque = data(2:end,1); rpm = data(1,2:end); eff_epk = data(2:end,2:end); Nm ...

9 días ago | 2

| accepted

Answered

How to make subplots scroll at the same time?

See the help and documentation for linkaxes (and possibly linkprop). I'd do something like this: %Create subplot sph1 = subplo...

How to make subplots scroll at the same time?

See the help and documentation for linkaxes (and possibly linkprop). I'd do something like this: %Create subplot sph1 = subplo...

9 días ago | 0

| accepted

Answered

how to vectorise or speed up the specific code

Newton says you can cut it in two if you take into account that the force from particle i on particle j is equal but directed in...

how to vectorise or speed up the specific code

Newton says you can cut it in two if you take into account that the force from particle i on particle j is equal but directed in...

12 días ago | 2

Answered

Why `sparse` function accumulate large sparse COO format matrix by index so fast?

Because sparse is a built-in function that Mathworks most likely have spent many man-months (we wouldn't know) on optimizing. Yo...

Why `sparse` function accumulate large sparse COO format matrix by index so fast?

Because sparse is a built-in function that Mathworks most likely have spent many man-months (we wouldn't know) on optimizing. Yo...

12 días ago | 0

Answered

How to create null vector Matlab

First off if you've done something like: N = 12; M = 14; K = 7; Mtr = randn(M,N); V = rand(1,K); V=zeros(1,length(N)-lengt...

How to create null vector Matlab

First off if you've done something like: N = 12; M = 14; K = 7; Mtr = randn(M,N); V = rand(1,K); V=zeros(1,length(N)-lengt...

13 días ago | 0

| accepted

Answered

i need to save images with different file names in seperate folders

You can do this, as Jan hinted at, something like this: faces = 1:6 face_names = {'top','bottom','front','back','left','right'...

i need to save images with different file names in seperate folders

You can do this, as Jan hinted at, something like this: faces = 1:6 face_names = {'top','bottom','front','back','left','right'...

15 días ago | 1

Answered

how to make a covarinace matrix using data from excel?

Just use cov. From the help of the cov-function: cov Covariance matrix. cov(X), if X is a vector, returns the variance. F...

how to make a covarinace matrix using data from excel?

Just use cov. From the help of the cov-function: cov Covariance matrix. cov(X), if X is a vector, returns the variance. F...

15 días ago | 0

Answered

How to make ticks labels (the numbers, not the axis labels.) bold when using latex interpreter.

This seems to work in general: set(gca,'fontweigth','bold') HTH

How to make ticks labels (the numbers, not the axis labels.) bold when using latex interpreter.

This seems to work in general: set(gca,'fontweigth','bold') HTH

15 días ago | 0

Answered

Average intensity as a function of angle in 2D FFT plot

This is kind-of-difficult in practice. Your fft has low-wavenumber components at [0,0], [1,0], [-1, 0], [0,1], [0,-1] and if we ...

Average intensity as a function of angle in 2D FFT plot

This is kind-of-difficult in practice. Your fft has low-wavenumber components at [0,0], [1,0], [-1, 0], [0,1], [0,-1] and if we ...

16 días ago | 1

Answered

How to substitute p(x/a+x1,y/a+x2) to p(x,y),where p(x,y) is original image, x1 and x2 are the centroid of p(x,y),x1=m10/m00,x2=m01/m00,a=sqrt(β/m00),β is a predetermined value. In fact, this is doing scale and translation normalization

You solve that with interp2: xi = xC + [-dx:dx]*xScale; yi = yC + [-dy:dy]*yScale; [xi,yi] = meshgrid(xi,yi); p_prime = inte...

How to substitute p(x/a+x1,y/a+x2) to p(x,y),where p(x,y) is original image, x1 and x2 are the centroid of p(x,y),x1=m10/m00,x2=m01/m00,a=sqrt(β/m00),β is a predetermined value. In fact, this is doing scale and translation normalization

You solve that with interp2: xi = xC + [-dx:dx]*xScale; yi = yC + [-dy:dy]*yScale; [xi,yi] = meshgrid(xi,yi); p_prime = inte...

16 días ago | 0

Answered

for loop with vectors having different sizes

To fool-proof your concatenation, and to generate better directory-names you could do something like this: a = [1 2]; b = [3 4...

for loop with vectors having different sizes

To fool-proof your concatenation, and to generate better directory-names you could do something like this: a = [1 2]; b = [3 4...

19 días ago | 0