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

How to constrain distance between points in optimization?

It can be set up this way, but keep in mind that this is a highly non-convex feasible set. It may be challenging to find a glob...

How to constrain distance between points in optimization?

It can be set up this way, but keep in mind that this is a highly non-convex feasible set. It may be challenging to find a glob...

alrededor de 3 horas ago | 0

Answered

Multidimensional operations without for loop

Q=nan(8,n); [J,K]=ndgrid(1:8,1:n); I=maxloc(K); thetaIndices=sub2ind(size(theta), I,J,K); QIndices=sub2ind(...

Multidimensional operations without for loop

Q=nan(8,n); [J,K]=ndgrid(1:8,1:n); I=maxloc(K); thetaIndices=sub2ind(size(theta), I,J,K); QIndices=sub2ind(...

3 días ago | 0

| accepted

Answered

fzero with function in matrix

syms x a=[sin(x),1;1,1]; b=[1/cos(x);1]; c=a*b; x=fzero( matlabFunction(c(1)-1) , pi/4 )

fzero with function in matrix

syms x a=[sin(x),1;1,1]; b=[1/cos(x);1]; c=a*b; x=fzero( matlabFunction(c(1)-1) , pi/4 )

3 días ago | 0

| accepted

Answered

How can i speed up my code?

Please do not provide code in the form of embedded images. It prevents us from conveniently copy/pasting relevant sections. In ...

How can i speed up my code?

Please do not provide code in the form of embedded images. It prevents us from conveniently copy/pasting relevant sections. In ...

3 días ago | 0

| accepted

Answered

Get the diagonal without calculating the explicit matrix

Assuming B*C results in a square matrix, diagonal=sum(B.' .* C, 1);

Get the diagonal without calculating the explicit matrix

Assuming B*C results in a square matrix, diagonal=sum(B.' .* C, 1);

4 días ago | 1

| accepted

Answered

Finding Area of Polygon defined by roipoly

roipoly returns a logical mask BW of the region BW = roipoly; so, its area in whole pixels would simply be area = sum(BW(:));...

Finding Area of Polygon defined by roipoly

roipoly returns a logical mask BW of the region BW = roipoly; so, its area in whole pixels would simply be area = sum(BW(:));...

4 días ago | 0

Answered

Setting nonlcon for fmincon / patternsearch as a matlabfunction

Create a wrapper function like the one below. To make it visible from the workspace where patternsearch is called, you can make ...

Setting nonlcon for fmincon / patternsearch as a matlabfunction

Create a wrapper function like the one below. To make it visible from the workspace where patternsearch is called, you can make ...

4 días ago | 1

| accepted

Answered

Use of kron with more than two matricies

One way would be to use my KronProd class https://www.mathworks.com/matlabcentral/fileexchange/25969-efficient-object-oriented-...

Use of kron with more than two matricies

One way would be to use my KronProd class https://www.mathworks.com/matlabcentral/fileexchange/25969-efficient-object-oriented-...

4 días ago | 1

| accepted

Answered

How to find a minimal number of rows in a sparse matrix to form a square sub-matrix for a given row?

If you have the Optimization Toolbox, you can try this linear programming solution: A = [ -1 1 0 0 0 0 ...

How to find a minimal number of rows in a sparse matrix to form a square sub-matrix for a given row?

If you have the Optimization Toolbox, you can try this linear programming solution: A = [ -1 1 0 0 0 0 ...

7 días ago | 0

| accepted

Answered

How to plot a single variable function with constraints

You can assign NaN to anything you don't want plotted. Example, x=linspace(0,2,1000); f=sin(x); f( 0.5<=x & x<=1)=nan; p...

How to plot a single variable function with constraints

You can assign NaN to anything you don't want plotted. Example, x=linspace(0,2,1000); f=sin(x); f( 0.5<=x & x<=1)=nan; p...

9 días ago | 0

Answered

How to quickly find the column index of the last non-zero element in all rows in a sparse matrix?

[~,idx]=max(fliplr(logical(A)),[],2); result=size(A,2)+1-idx;

How to quickly find the column index of the last non-zero element in all rows in a sparse matrix?

[~,idx]=max(fliplr(logical(A)),[],2); result=size(A,2)+1-idx;

10 días ago | 0

Answered

Create n equidistant point along a circle

theta=linspace(0,360,n+1); theta(end)=[]; x=R*cosd(theta)+x0; y=R*sind(theta)+y0;

Create n equidistant point along a circle

theta=linspace(0,360,n+1); theta(end)=[]; x=R*cosd(theta)+x0; y=R*sind(theta)+y0;

10 días ago | 0

| accepted

Answered

polyfit curve turns around near last point

Your data, when plotted alone, do not look very polynomial like. They do not even look like a function. x = [0 0 -0.0063 -0...

polyfit curve turns around near last point

Your data, when plotted alone, do not look very polynomial like. They do not even look like a function. x = [0 0 -0.0063 -0...

11 días ago | 0

Answered

How to quickly find the first non-zero element without iterations in all columns in a sparse matrix?

See this FEX submission, https://www.mathworks.com/matlabcentral/fileexchange/24641-vectorized-find-with-first-option

How to quickly find the first non-zero element without iterations in all columns in a sparse matrix?

See this FEX submission, https://www.mathworks.com/matlabcentral/fileexchange/24641-vectorized-find-with-first-option

11 días ago | 0

Answered

How to quickly find the first non-zero element without iterations in all columns in a sparse matrix?

[~,result]=max(logical(A),[],1);

How to quickly find the first non-zero element without iterations in all columns in a sparse matrix?

[~,result]=max(logical(A),[],1);

11 días ago | 0

| accepted

Answered

Use fsolve with an elliptic integral

It does not make sense to have a relational expression like, [K, E]== ellipke(m) as one of your equations, expecially one that...

Use fsolve with an elliptic integral

It does not make sense to have a relational expression like, [K, E]== ellipke(m) as one of your equations, expecially one that...

12 días ago | 0

| accepted

Answered

Unclassified variables in a parfor loop

parfor i= 1:xyend-xystart+1 .... A = zeros(nx,ny); B = A; for n=1:Nn; for m=1:Mm; ...

Unclassified variables in a parfor loop

parfor i= 1:xyend-xystart+1 .... A = zeros(nx,ny); B = A; for n=1:Nn; for m=1:Mm; ...

13 días ago | 0

| accepted

Submitted

PROB2MATRICES: A selective version of prob2struct

Obtains matrices for select parts of an optimization problem from problem-based description.

13 días ago | 10 downloads |

Answered

Should I trust solutions obtained for a nonlinear non-transcendental equation in matlab using 'fzero' function?

fzero is a numerical root finder. One doesn't expect y(x) to be exactly zero at the roots that it finds, but it should be pretty...

Should I trust solutions obtained for a nonlinear non-transcendental equation in matlab using 'fzero' function?

fzero is a numerical root finder. One doesn't expect y(x) to be exactly zero at the roots that it finds, but it should be pretty...

14 días ago | 0

Answered

How to Put Objective and Constraints functions in the same function ?

I am working on an optimization problem with non linear inequality constraints and i wish to put the objective and constraints f...

How to Put Objective and Constraints functions in the same function ?

I am working on an optimization problem with non linear inequality constraints and i wish to put the objective and constraints f...

14 días ago | 0

Answered

fmincon check gradients fail

CheckGradient uses central differences, whereas you appear to be using right handed differences. Are you certain that your const...

fmincon check gradients fail

CheckGradient uses central differences, whereas you appear to be using right handed differences. Are you certain that your const...

15 días ago | 0

| accepted

Answered

Minimising the summation of distance between two curves by placing the arc at best distance from origin

It's a non-differentiable, one dimensional cost function minimization. I would use fminbnd, https://www.mathworks.com/help/matl...

Minimising the summation of distance between two curves by placing the arc at best distance from origin

It's a non-differentiable, one dimensional cost function minimization. I would use fminbnd, https://www.mathworks.com/help/matl...

17 días ago | 0

Answered

Calling a class's static method from its metadata

or indeed a better way entirely from what I am proposing to achieve the calling of such an abstract static function on all subcl...

Calling a class's static method from its metadata

or indeed a better way entirely from what I am proposing to achieve the calling of such an abstract static function on all subcl...

17 días ago | 0

Answered

How do I feed data from a non linear constraint function to the objective function when using fmincon?

Since your unknown vector is x, your objective and constraints must be functions of x and nothing else (except known constants w...

How do I feed data from a non linear constraint function to the objective function when using fmincon?

Since your unknown vector is x, your objective and constraints must be functions of x and nothing else (except known constants w...

18 días ago | 0

Answered

Gradient Based and Gradient free Optimization

and my objectif function is very sensible in a way that if i change one coefficient value by 0.0001, i'll get inf as a results (...

Gradient Based and Gradient free Optimization

and my objectif function is very sensible in a way that if i change one coefficient value by 0.0001, i'll get inf as a results (...

18 días ago | 0

| accepted

Answered

Genetic algorithm constraints/optimization toolbox

You need to write your fitness function and all of your constraints in terms of 12 unknowns. The constraint matrices must be wri...

Genetic algorithm constraints/optimization toolbox

You need to write your fitness function and all of your constraints in terms of 12 unknowns. The constraint matrices must be wri...

18 días ago | 0

Answered

Mathematical formulation of a operations research problem

Should be very easy with the Problem-Based Optimization Workflow.

Mathematical formulation of a operations research problem

Should be very easy with the Problem-Based Optimization Workflow.

18 días ago | 1

| accepted

Answered

How to find a figure's centroid inside a polyshape?

In fact Matt, anywhere within the limits is already viable for me. If so, you could use nearestvertex command to project the ce...

How to find a figure's centroid inside a polyshape?

In fact Matt, anywhere within the limits is already viable for me. If so, you could use nearestvertex command to project the ce...

18 días ago | 1

| accepted

Answered

Integral evaluation in an alphashape

Perhaps as follows. Here, shp refers to your alphaShape object. fun=@(x,y,z) (x.^2+y.^2+z.^2).*shp.inShape(x,y,z); range=num...

Integral evaluation in an alphashape

Perhaps as follows. Here, shp refers to your alphaShape object. fun=@(x,y,z) (x.^2+y.^2+z.^2).*shp.inShape(x,y,z); range=num...

18 días ago | 0

Answered

Max number iterations for tolerance

Call fminsearch with more output arguments to get information about how many iterations it took. x0 = [3,4]; options = optimse...

Max number iterations for tolerance

Call fminsearch with more output arguments to get information about how many iterations it took. x0 = [3,4]; options = optimse...

19 días ago | 0