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

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));

ungefär 11 timmar 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...

ungefär 12 timmar ago | 0

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...

ungefär 19 timmar 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,:...

en dag 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 ...

2 dagar 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 = ...

2 dagar 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...

3 dagar 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...

3 dagar 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,... ...

3 dagar 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.').';

4 dagar 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...

4 dagar 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...

4 dagar 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...

4 dagar 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...

5 dagar 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?

5 dagar 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...

5 dagar 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...

6 dagar 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...

7 dagar ago | 1

| accepted

Answered

curve fitting with dependencies between the coefficients

Re-express your model function as, sin(d1)^2*(1-exp(-a1*(t^n1))) + cos(d1)^2*sin(d2)^2*(1-exp(-a2*(t^n2))) +... ...

curve fitting with dependencies between the coefficients

Re-express your model function as, sin(d1)^2*(1-exp(-a1*(t^n1))) + cos(d1)^2*sin(d2)^2*(1-exp(-a2*(t^n2))) +... ...

8 dagar ago | 0

Answered

What happens if I use parfor and the fmincon/fminunc option "UseParallel" together?

I don't know the answer to that directly, but it is easy to show by example that turning off 'UseParallel' can be beneficial: o...

What happens if I use parfor and the fmincon/fminunc option "UseParallel" together?

I don't know the answer to that directly, but it is easy to show by example that turning off 'UseParallel' can be beneficial: o...

8 dagar ago | 0

Answered

fmincon Constraint Query Optimization

Generally, all constraints must operate on the total set of unknows x1,..x10. However, given A1,A2, b1,b2 it is simple enough to...

fmincon Constraint Query Optimization

Generally, all constraints must operate on the total set of unknows x1,..x10. However, given A1,A2, b1,b2 it is simple enough to...

8 dagar ago | 0

| accepted

Answered

show det(A) = det(A') ?

But it's not true! A=rand(200); isequal(det(A),det(A.'))

show det(A) = det(A') ?

But it's not true! A=rand(200); isequal(det(A),det(A.'))

8 dagar ago | 0

Answered

Optimization problem on Constraint declaration

We can't tell from your code what the relation is supposed to be between a, wd and x. This might be what you were trying to do, ...

Optimization problem on Constraint declaration

We can't tell from your code what the relation is supposed to be between a, wd and x. This might be what you were trying to do, ...

8 dagar ago | 0

| accepted

Answered

How to use for loop to set properties' attributes in MATLAB class?

You cannot put a for loop or other complex code inside a properties block. If you wish, you can set a default value for a proper...

How to use for loop to set properties' attributes in MATLAB class?

You cannot put a for loop or other complex code inside a properties block. If you wish, you can set a default value for a proper...

8 dagar ago | 1

| accepted

Answered

Using the given code, how can I optimize a matrix to minimize a cost function?

Well, the way you would approach it is using fmincon as below. Using your initial guess of zeros(N,M), fmincon is unable to find...

Using the given code, how can I optimize a matrix to minimize a cost function?

Well, the way you would approach it is using fmincon as below. Using your initial guess of zeros(N,M), fmincon is unable to find...

8 dagar ago | 0

| accepted

Answered

How to input dependent parameters in matlab function?

These two, out = myfun(A,B,optionC,dependent_C1) out = myfun(A,B,optionC,dependent_C2) are not possible simultaneously. If ...

How to input dependent parameters in matlab function?

These two, out = myfun(A,B,optionC,dependent_C1) out = myfun(A,B,optionC,dependent_C2) are not possible simultaneously. If ...

9 dagar ago | 0

| accepted

Answered

fmincon - Converged to an infeasible point.

The max() operations in your constraints disqualify fmincon as a valid tool for this problem - the constraint functions are assu...

fmincon - Converged to an infeasible point.

The max() operations in your constraints disqualify fmincon as a valid tool for this problem - the constraint functions are assu...

10 dagar ago | 0

Answered

checking input an integer greater than 0?

validateattributes(yourInput,"numeric",{"integer","nonnegative"})

checking input an integer greater than 0?

validateattributes(yourInput,"numeric",{"integer","nonnegative"})

10 dagar ago | 0

Answered

Why do the ylabel renderings look different when Property Inspector says they are the same?

I figured it out. The syntax for the second plot needed to be, ylabel('Local Deviation (\%)','Interpreter','latex') ; %percent ...

Why do the ylabel renderings look different when Property Inspector says they are the same?

I figured it out. The syntax for the second plot needed to be, ylabel('Local Deviation (\%)','Interpreter','latex') ; %percent ...

10 dagar ago | 0

| accepted