5,588 total contributions since 2009

Professional Interests: medical image processing, optimization algorithms

PLEASE NOTE: I do not read email sent through my author page. Please post questions about FEX submissions in their respective Comments section.

Answered

use 3D free form deformation for 3D image registration

There is imwarp, interpn, and griddedInterpolant.

use 3D free form deformation for 3D image registration

There is imwarp, interpn, and griddedInterpolant.

3 hours ago | 0

| accepted

Answered

Failure in initial objective function evaluation. FMINCON cannot continue

Test F1 on X0 before you give it to fmincon.

Failure in initial objective function evaluation. FMINCON cannot continue

Test F1 on X0 before you give it to fmincon.

7 hours ago | 0

Answered

Why does my integral not work without the command "global"

To get rid of global, implement as follows a=1; k=1; T=1; q=integral(@(t)a.*t.^k,0,T);

Why does my integral not work without the command "global"

To get rid of global, implement as follows a=1; k=1; T=1; q=integral(@(t)a.*t.^k,0,T);

1 day ago | 0

| accepted

Answered

Fminunc - complex standard errrors from taking inverse of Hessian

You can also try this finite differencer to see if it gives you better Hessian calculation https://www.mathworks.com/matlabcent...

Fminunc - complex standard errrors from taking inverse of Hessian

You can also try this finite differencer to see if it gives you better Hessian calculation https://www.mathworks.com/matlabcent...

1 day ago | 0

Answered

eigs bug for 0 as lowest eigenvalue in parts of the matlab versions

From Tech Support: The issue that you are seeing is because of a bug which was introduced in R2017b, while implementing the ref...

eigs bug for 0 as lowest eigenvalue in parts of the matlab versions

From Tech Support: The issue that you are seeing is because of a bug which was introduced in R2017b, while implementing the ref...

1 day ago | 3

| accepted

Answered

Fminunc - complex standard errrors from taking inverse of Hessian

For the purpose of standard error computation, you should do a separate analytical computation of the Hessian at the final point...

Fminunc - complex standard errrors from taking inverse of Hessian

For the purpose of standard error computation, you should do a separate analytical computation of the Hessian at the final point...

1 day ago | 0

Answered

Subscripted assignment dimension mismatch.

sxint(3,:) is not a scalar, but the left hand side S(i,1) is a scalar location.

Subscripted assignment dimension mismatch.

sxint(3,:) is not a scalar, but the left hand side S(i,1) is a scalar location.

4 days ago | 0

Answered

eigs bug for 0 as lowest eigenvalue in parts of the matlab versions

That does seem like an interesting bug. This seems to work though Eg_sp = eigs(sp_matrix,1,1e-12);

eigs bug for 0 as lowest eigenvalue in parts of the matlab versions

That does seem like an interesting bug. This seems to work though Eg_sp = eigs(sp_matrix,1,1e-12);

4 days ago | 0

Answered

Create a vector of vector exponents

No, a for-loop is fastest, but you want to implement it the right way, with a recursive update, m=repmat(v*A,n,1); %pre-allocat...

Create a vector of vector exponents

No, a for-loop is fastest, but you want to implement it the right way, with a recursive update, m=repmat(v*A,n,1); %pre-allocat...

4 days ago | 0

| accepted

Answered

subtract each pixel from average pixel value

It seems deceptively simple... Image-meanValue

subtract each pixel from average pixel value

It seems deceptively simple... Image-meanValue

4 days ago | 0

| accepted

Answered

fmincon should return a scalar value error

AC Power reetuns 8760*1 value If you know that your objective function code is returning a 8760x1 value, it should be pretty cl...

fmincon should return a scalar value error

AC Power reetuns 8760*1 value If you know that your objective function code is returning a 8760x1 value, it should be pretty cl...

4 days ago | 0

| accepted

Answered

Help in understanding optimization problems and solving them in Matlab (choise of appropriate solver)

You have to reformulate the problem with a convex objective to be certain that the Lagrangian minimization will behave as you're...

Help in understanding optimization problems and solving them in Matlab (choise of appropriate solver)

You have to reformulate the problem with a convex objective to be certain that the Lagrangian minimization will behave as you're...

4 days ago | 1

| accepted

Answered

How to delete repeating column or duplicate column in MATLAB? of type Double

output_array=unique(input_array.','rows').'

How to delete repeating column or duplicate column in MATLAB? of type Double

output_array=unique(input_array.','rows').'

4 days ago | 2

| accepted

Answered

imregister translation mode, suppress registration in second direction

One hack that I can think of (and I emphasize that it is only a hack) is to deliberately corrupt the images with bright horizont...

imregister translation mode, suppress registration in second direction

One hack that I can think of (and I emphasize that it is only a hack) is to deliberately corrupt the images with bright horizont...

11 days ago | 0

| accepted

Answered

fsolve error using trustnleqn (line 28)

The initial point is [0;0;0;0;0;0;0;0;0]. Calling your function at this point gives something with NaNs >> equilibrium([0;0;0;0...

fsolve error using trustnleqn (line 28)

The initial point is [0;0;0;0;0;0;0;0;0]. Calling your function at this point gives something with NaNs >> equilibrium([0;0;0;0...

11 days ago | 0

| accepted

Answered

how to full fill the diagonal of a matrix by a vector

You can use interpMatrix from the File Exchange >> full(interpMatrix([1,2,3],1,5,1,'circ')) ans = 1 0 0 ...

how to full fill the diagonal of a matrix by a vector

You can use interpMatrix from the File Exchange >> full(interpMatrix([1,2,3],1,5,1,'circ')) ans = 1 0 0 ...

11 days ago | 1

Answered

For loop not running properly

17.99 does not have an exact binary floating point representation >> format long >> 17.99 ans = 17.989999999999998 So...

For loop not running properly

17.99 does not have an exact binary floating point representation >> format long >> 17.99 ans = 17.989999999999998 So...

11 days ago | 0

| accepted

Answered

Efficiently calculating the trace of a matrix product

Bt=B.'; traceProduct = A(:).'*Bt(:);

Efficiently calculating the trace of a matrix product

Bt=B.'; traceProduct = A(:).'*Bt(:);

12 days ago | 2

| accepted

Answered

Solving a linear equation using least-squares (Calibration Matrix)

Are these equations for projective transformations? If so, they are not really linear equations. They are accurate only up to so...

Solving a linear equation using least-squares (Calibration Matrix)

Are these equations for projective transformations? If so, they are not really linear equations. They are accurate only up to so...

12 days ago | 0

Answered

Using the global operator

No, you should not use global. Your code should look like this: function [ll, mm, kk]= ssample(e2,t,kk) ... end

Using the global operator

No, you should not use global. Your code should look like this: function [ll, mm, kk]= ssample(e2,t,kk) ... end

13 days ago | 0

| accepted

Answered

Best Way to Set Private Properties in Class Constructor

There's nothing wrong with the first version of the code you posted (the one with the nargin tests). Also, there is no reason yo...

Best Way to Set Private Properties in Class Constructor

There's nothing wrong with the first version of the code you posted (the one with the nargin tests). Also, there is no reason yo...

13 days ago | 0

| accepted

Answered

unbounded problem in linprog but not in fmincon

If the problem is as below, then I obtain the same solution essentially from both linprog and fmincon FUN= @(x) 150*x(1)+230*x(...

unbounded problem in linprog but not in fmincon

If the problem is as below, then I obtain the same solution essentially from both linprog and fmincon FUN= @(x) 150*x(1)+230*x(...

13 days ago | 0

Answered

Solving a linear equation using least-squares (Calibration Matrix)

W=[ones(1,n);X]; Z=F/W; A=Z(:,1); C=Z(:,2:end);

Solving a linear equation using least-squares (Calibration Matrix)

W=[ones(1,n);X]; Z=F/W; A=Z(:,1); C=Z(:,2:end);

13 days ago | 0

| accepted

Answered

fmincon unidentified variable in objective function

This should fix it, FUN= @(x)150*x(1)+230*x(2)+260*x(3)+238*x(5)-170*x(4)+210*x(7)-150*x(6)-36*x(8)-10*x(9); however, you shou...

fmincon unidentified variable in objective function

This should fix it, FUN= @(x)150*x(1)+230*x(2)+260*x(3)+238*x(5)-170*x(4)+210*x(7)-150*x(6)-36*x(8)-10*x(9); however, you shou...

13 days ago | 1

| accepted

Answered

Dimensions of arrays being concatenated are not consistent.

No need to loop, E=[0,40,65,55,inf]; [binct,~,G]=histcounts(p,E); ypartmean=splitapply(@mean,d,G);

Dimensions of arrays being concatenated are not consistent.

No need to loop, E=[0,40,65,55,inf]; [binct,~,G]=histcounts(p,E); ypartmean=splitapply(@mean,d,G);

13 days ago | 0

| accepted

Answered

Choosing a GPU workstation

Yes, the GPU uses its own local RAM to do computations (or at least that's when it is fast), so you should get a graphics card w...

Choosing a GPU workstation

Yes, the GPU uses its own local RAM to do computations (or at least that's when it is fast), so you should get a graphics card w...

13 days ago | 1

| accepted

Answered

How to give index to each replicated number?

Yes correct! In that case, S=sparse( 1:numel(a), findgroups(a), 1); S(S>0)=nonzeros( cumsum(sort(S)) ); b=full(s...

How to give index to each replicated number?

Yes correct! In that case, S=sparse( 1:numel(a), findgroups(a), 1); S(S>0)=nonzeros( cumsum(sort(S)) ); b=full(s...

14 days ago | 0

Answered

How to give index to each replicated number?

G=cumsum(diff([0,a])~=0); b=cell2mat(splitapply(@(g){1:numel(g)}, G,G));

How to give index to each replicated number?

G=cumsum(diff([0,a])~=0); b=cell2mat(splitapply(@(g){1:numel(g)}, G,G));

14 days ago | 0

Answered

Can I use the Jacobian provided by 'lsqnonlin' to compute the confidence intervals using 'nlparci'?

nlparci probably wouldn't be applicable if you used lsqnonlin with bound constraints, unless the bounds were inactive at the sol...

Can I use the Jacobian provided by 'lsqnonlin' to compute the confidence intervals using 'nlparci'?

nlparci probably wouldn't be applicable if you used lsqnonlin with bound constraints, unless the bounds were inactive at the sol...

16 days ago | 3

Answered

Insert variable name into another variable

You would re-write all of your code to look like this instead Faces=StarFace{Number} or this Faces=StarFace(Number) See also...

Insert variable name into another variable

You would re-write all of your code to look like this instead Faces=StarFace{Number} or this Faces=StarFace(Number) See also...

18 days ago | 1