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

Running function on GPU for all combination of variables

Here's a loop-free method using ndgridVecs, https://www.mathworks.com/matlabcentral/fileexchange/74956-ndgridvecs but bear in ...

Running function on GPU for all combination of variables

Here's a loop-free method using ndgridVecs, https://www.mathworks.com/matlabcentral/fileexchange/74956-ndgridvecs but bear in ...

15 hours ago | 0

Answered

construction of diagonal matrix of functions

This might be what you want. It assumes that f_1,2,3(x) work element-wise. function A=func(x) f1=f_1(x(1:end-1)); f2=f_2(...

construction of diagonal matrix of functions

This might be what you want. It assumes that f_1,2,3(x) work element-wise. function A=func(x) f1=f_1(x(1:end-1)); f2=f_2(...

16 hours ago | 0

| accepted

Answered

construction of diagonal matrix of functions

function A=func(x,n) e=zeros(1,n-2); f1=f_1(x); f2=f_2(x); f3=f_3(x); A=toeplitz([f2,f1,e], [f2,f3,e]); ...

construction of diagonal matrix of functions

function A=func(x,n) e=zeros(1,n-2); f1=f_1(x); f2=f_2(x); f3=f_3(x); A=toeplitz([f2,f1,e], [f2,f3,e]); ...

16 hours ago | 0

Answered

Running function on GPU for all combination of variables

In this case, I'd use parfor to descrease the simulation duration, but the size of this variable is quite large so I'd prefer to...

Running function on GPU for all combination of variables

In this case, I'd use parfor to descrease the simulation duration, but the size of this variable is quite large so I'd prefer to...

17 hours ago | 0

Answered

Optimization of a unknown vector variable

H1=sum(h1); H2=sum(h2); H3=sum(h3); obj=@(a,b) H1.*a.^2 +H2.*b.^2+H3; x0=[1,1]; lb = []; ub = []; Aeq = []; beq =[];...

Optimization of a unknown vector variable

H1=sum(h1); H2=sum(h2); H3=sum(h3); obj=@(a,b) H1.*a.^2 +H2.*b.^2+H3; x0=[1,1]; lb = []; ub = []; Aeq = []; beq =[];...

19 hours ago | 0

Answered

Is it possible to find out an unknown variable within constraint which is not present in the objective for a optimization problem?

Yes. It is not a problem if your objective only depends on a subset of variables. However, you must pass the full unknown vector...

Is it possible to find out an unknown variable within constraint which is not present in the objective for a optimization problem?

Yes. It is not a problem if your objective only depends on a subset of variables. However, you must pass the full unknown vector...

1 day ago | 0

| accepted

Answered

FSOLVE GIVES SAME VALUE

clc;clearvars;close all; format short g;format compact; tfinal=30; pars.D=0.00005611; pars.x2f=20; pars.Y=0.4; pars.beta=0....

FSOLVE GIVES SAME VALUE

clc;clearvars;close all; format short g;format compact; tfinal=30; pars.D=0.00005611; pars.x2f=20; pars.Y=0.4; pars.beta=0....

1 day ago | 0

Answered

Linprog stopped because no point satisfies the constraints.

linprog is telling you that no solution exists, because there is no x that satisfies your constraints. Your problem must have a ...

Linprog stopped because no point satisfies the constraints.

linprog is telling you that no solution exists, because there is no x that satisfies your constraints. Your problem must have a ...

1 day ago | 0

Answered

How can I straighten edges of calibrated images ?

Try setting the 'OutputView' option to 'valid' https://www.mathworks.com/help/vision/ref/undistortfisheyeimage.html#d122e205695...

How can I straighten edges of calibrated images ?

Try setting the 'OutputView' option to 'valid' https://www.mathworks.com/help/vision/ref/undistortfisheyeimage.html#d122e205695...

2 days ago | 1

Answered

Matlab close when run

You are using an undefined variable called "k" inside myfun at this line vtk=vt/k; %<--- k not defined here

Matlab close when run

You are using an undefined variable called "k" inside myfun at this line vtk=vt/k; %<--- k not defined here

2 days ago | 0

Answered

lsqnonlin seems stuck at the same residual value,norm step and first order optimality for a while now

For a 3-variable problem known to have non-differentiabilities, it would make sense to use fminsearch instead of lsqnonlin. Ther...

lsqnonlin seems stuck at the same residual value,norm step and first order optimality for a while now

For a 3-variable problem known to have non-differentiabilities, it would make sense to use fminsearch instead of lsqnonlin. Ther...

3 days ago | 0

Answered

Optimization function based on different domain of optimized variables

Solve the problem twice, once with the constraint x1<=k and once with x1>=k, imposing the appropriate objective function in each...

Optimization function based on different domain of optimized variables

Solve the problem twice, once with the constraint x1<=k and once with x1>=k, imposing the appropriate objective function in each...

3 days ago | 0

| accepted

Answered

Change white pixels to invisible

Shouldn't you have alphachannel = 1-double(all(image == 255, 3));

Change white pixels to invisible

Shouldn't you have alphachannel = 1-double(all(image == 255, 3));

3 days ago | 0

Answered

Converting strings to operators

I can't tell if you really intend S to be a string vector because that dpesn't agree with the example you posted. If I assume it...

Converting strings to operators

I can't tell if you really intend S to be a string vector because that dpesn't agree with the example you posted. If I assume it...

3 days ago | 1

Answered

optimization problem of areas

Your objective function Area2 is written to be a function of z, but nothing in sum( ( x.*dt(m(1):c(1)) ) ) depnds on z. Perha...

optimization problem of areas

Your objective function Area2 is written to be a function of z, but nothing in sum( ( x.*dt(m(1):c(1)) ) ) depnds on z. Perha...

3 days ago | 0

| accepted

Answered

Fmincon gives relative maximum constraint violation but still gives output due to conflicting constraints.

For example, [tmp,fval,exitflag] = fmincon(Total_Profit,Guess,A,b,Aeq,beq,LB,UB,[],options); if exitflag>0 xopt(i,:...

Fmincon gives relative maximum constraint violation but still gives output due to conflicting constraints.

For example, [tmp,fval,exitflag] = fmincon(Total_Profit,Guess,A,b,Aeq,beq,LB,UB,[],options); if exitflag>0 xopt(i,:...

4 days ago | 0

Answered

Calculate the midpoint of two lines on a track

The effectiveness of any solution we give will depend on whether the illumination levels of every frame will be similar to your ...

Calculate the midpoint of two lines on a track

The effectiveness of any solution we give will depend on whether the illumination levels of every frame will be similar to your ...

5 days ago | 0

Answered

Preallocation within an optimization loop

xopt=nan(runs,2); %Pre-allocate Total_Private_Profit=nan(runs,2); %Pre-allocate for i = ...

Preallocation within an optimization loop

xopt=nan(runs,2); %Pre-allocate Total_Private_Profit=nan(runs,2); %Pre-allocate for i = ...

5 days ago | 0

| accepted

Answered

orthagonal planes and normal vectors

format long; A=normalize( [3,2,-1; 3,-8,-7;-22,18,-30] ,2,'norm'); If they are orthogonal, this should give the identity matr...

orthagonal planes and normal vectors

format long; A=normalize( [3,2,-1; 3,-8,-7;-22,18,-30] ,2,'norm'); If they are orthogonal, this should give the identity matr...

6 days ago | 1

Answered

Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.699518e-25.

If C is singular, then C is singular and that's all there is to it. However, this will make the same inversion slightly less sin...

Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.699518e-25.

If C is singular, then C is singular and that's all there is to it. However, this will make the same inversion slightly less sin...

6 days ago | 0

| accepted

Answered

How to plot the trajectory that fminsearch follows?

trajectory=doIt(); fcontour(@rosenbrock, [0 3 -3 3],'LineColor', '#00FFFF', 'MeshDensity',50,... ...

How to plot the trajectory that fminsearch follows?

trajectory=doIt(); fcontour(@rosenbrock, [0 3 -3 3],'LineColor', '#00FFFF', 'MeshDensity',50,... ...

6 days ago | 1

| accepted

Answered

Sparse vs Least square solution differ at the edges

Because you forgot to transpose c, s2 = mldivide(full(c.'),b.').';

Sparse vs Least square solution differ at the edges

Because you forgot to transpose c, s2 = mldivide(full(c.'),b.').';

6 days ago | 0

| accepted

Answered

Drawing upon general, user-created mfiles and .mat files for the Answers forum RUN feature

Here is a test of the technique using an attached mfunction. websave('testfunction', 'https://www.mathworks.com/matlabcentral/a...

Drawing upon general, user-created mfiles and .mat files for the Answers forum RUN feature

Here is a test of the technique using an attached mfunction. websave('testfunction', 'https://www.mathworks.com/matlabcentral/a...

7 days ago | 0

Question

Drawing upon general, user-created mfiles and .mat files for the Answers forum RUN feature

Thanks to brilliant advice from Ameer Hamza, I have found a way to draw upon URL-posted .mat files as input to the Matlab Answer...

7 days ago | 1 answer | 0

Answered

Help me how to find the base of the intersection of two subspaces

If the vectors form the columns of a matrix A and the vectors form the columns of a matrix B, then the basis of the intersecti...

Help me how to find the base of the intersection of two subspaces

If the vectors form the columns of a matrix A and the vectors form the columns of a matrix B, then the basis of the intersecti...

7 days ago | 1

| accepted

Answered

Using blockproc to simply copy an array

Using sepblockfun from the file exchange, https://www.mathworks.com/matlabcentral/fileexchange/48089-separable-block-wise-opera...

Using blockproc to simply copy an array

Using sepblockfun from the file exchange, https://www.mathworks.com/matlabcentral/fileexchange/48089-separable-block-wise-opera...

7 days ago | 0

Answered

Random number generator with max and min values included in the matrix

I believe your code already works as written. Problem solved?

Random number generator with max and min values included in the matrix

I believe your code already works as written. Problem solved?

7 days ago | 0

Answered

Optimize model parameters given minimum sum of error square

It does not make sense that there are randomization operations like normrnd in your objective function. How can a function be "m...

Optimize model parameters given minimum sum of error square

It does not make sense that there are randomization operations like normrnd in your objective function. How can a function be "m...

7 days ago | 0

Question

Save and load alternative sets of preferences

I know how to set Preferences in Matlab through GUI buttons, however, suppose I have different sets of preferences that I wou...

9 days ago | 1 answer | 0

Answered

fsolve with one variabel

I don't understand why you would be using Symbolic Math Toolbox variables, syms x unless you were planning to use solve, Tinc...

fsolve with one variabel

I don't understand why you would be using Symbolic Math Toolbox variables, syms x unless you were planning to use solve, Tinc...

10 days ago | 1

| accepted