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

Can I change degrees to radians by simply changing from sind to sin?

cos and sin will assume the input angles are measured in radians. If theta is in degrees, you must convert to radians in order t...

Can I change degrees to radians by simply changing from sind to sin?

cos and sin will assume the input angles are measured in radians. If theta is in degrees, you must convert to radians in order t...

alrededor de 1 hora ago | 1

| accepted

Answered

How to use linear and quadratic programming to optimize w to solve the following problem

This looks like a direct application of lsqlin https://www.mathworks.com/help/optim/ug/lsqlin.html

How to use linear and quadratic programming to optimize w to solve the following problem

This looks like a direct application of lsqlin https://www.mathworks.com/help/optim/ug/lsqlin.html

alrededor de 2 horas ago | 0

Answered

count number of indices

Using group1s from the File Exchange https://www.mathworks.com/matlabcentral/fileexchange/78008-group1s col2=arrayA(:,2); I...

count number of indices

Using group1s from the File Exchange https://www.mathworks.com/matlabcentral/fileexchange/78008-group1s col2=arrayA(:,2); I...

alrededor de 2 horas ago | 0

Submitted

Extract linearly independent subset of matrix columns

Loop-free code routine to find a maximal subset of linearly independent columns in a matrix

1 día ago | 3 downloads |

Answered

How do I partition a n by m matrix into equal rows

Hint: Consider repelem https://www.mathworks.com/help/matlab/ref/repelem.html

How do I partition a n by m matrix into equal rows

Hint: Consider repelem https://www.mathworks.com/help/matlab/ref/repelem.html

2 días ago | 0

Answered

Integral calculation using matlab

My difficulty stems from the absolute value which is "outside" of the integral Why is this a difficulty? Because it prevents yo...

Integral calculation using matlab

My difficulty stems from the absolute value which is "outside" of the integral Why is this a difficulty? Because it prevents yo...

2 días ago | 0

Answered

finite difference step size value in fmincon

You might try the sqp or interior point algorithm, instead of whatever fmincon algorithm setting you are currently using. Accord...

finite difference step size value in fmincon

You might try the sqp or interior point algorithm, instead of whatever fmincon algorithm setting you are currently using. Accord...

2 días ago | 0

| accepted

Answered

fmincon output is converging to infeasible point

It appears that you are simply trying to find a point where getCost(Y) returns zero. If so, it might make it easier on the algor...

fmincon output is converging to infeasible point

It appears that you are simply trying to find a point where getCost(Y) returns zero. If so, it might make it easier on the algor...

2 días ago | 0

Answered

Algorithm to extract linearly dependent columns in a matrix

See this FEX contribution https://www.mathworks.com/matlabcentral/fileexchange/77437-extract-linearly-independent-subset-of-mat...

Algorithm to extract linearly dependent columns in a matrix

See this FEX contribution https://www.mathworks.com/matlabcentral/fileexchange/77437-extract-linearly-independent-subset-of-mat...

2 días ago | 2

Answered

fminbnd loop leads to same optimizer

In addition to hwat John said, you could plot the function to confirm whether fminbnd is giving you a good approximation of the ...

fminbnd loop leads to same optimizer

In addition to hwat John said, you could plot the function to confirm whether fminbnd is giving you a good approximation of the ...

3 días ago | 0

| accepted

Answered

return a single vector after a for loop and not individual results

For a fully vectorized solution: [maxval,place]=max(Divergence<=5,[],2); place(maxval==0)=nan; Or, to do the same with a loop...

return a single vector after a for loop and not individual results

For a fully vectorized solution: [maxval,place]=max(Divergence<=5,[],2); place(maxval==0)=nan; Or, to do the same with a loop...

3 días ago | 0

| accepted

Answered

Index in position 1 exceeds array bounds (must not exceed 1). FMINCON

Make theta0 a column vector: >> theta0 = [2,0.2,0.1,0.4].' theta0 = 2.0000 0.2000 0.1000 0.4000

Index in position 1 exceeds array bounds (must not exceed 1). FMINCON

Make theta0 a column vector: >> theta0 = [2,0.2,0.1,0.4].' theta0 = 2.0000 0.2000 0.1000 0.4000

4 días ago | 0

| accepted

Answered

How can I determine the amount of times a certain value can be achieved by summing values in a matrix?

Below is a more advanced version of my original answer, which is showing greater empirical succes. It incorporates initializatio...

How can I determine the amount of times a certain value can be achieved by summing values in a matrix?

Below is a more advanced version of my original answer, which is showing greater empirical succes. It incorporates initializatio...

5 días ago | 0

Answered

How to logically index multiple indices while indexing other indices normally?

You probably won't notice much difference with such small data sizes, but reshape is slightly better than permute because it wil...

How to logically index multiple indices while indexing other indices normally?

You probably won't notice much difference with such small data sizes, but reshape is slightly better than permute because it wil...

5 días ago | 0

| accepted

Answered

How do I get every combination of 3 vectors?

Example: [X,Y,Z]=ndgrid(1:3,10:15,100:102); [X(:),Y(:),Z(:)]

How do I get every combination of 3 vectors?

Example: [X,Y,Z]=ndgrid(1:3,10:15,100:102); [X(:),Y(:),Z(:)]

5 días ago | 1

Answered

Particularly strange bug using the eval function

I also know that MATHWORKS would prefer me not to define variables that clash with their own builtins. However, the code st...

Particularly strange bug using the eval function

I also know that MATHWORKS would prefer me not to define variables that clash with their own builtins. However, the code st...

5 días ago | 2

Answered

Can one set up initial values for fminbnd?

No, you cannot. However, you might get a comparable effect if you use fminsearch instead, setting your objective to Inf outside ...

Can one set up initial values for fminbnd?

No, you cannot. However, you might get a comparable effect if you use fminsearch instead, setting your objective to Inf outside ...

5 días ago | 0

| accepted

Answered

Given a point, locate 3 point in different 8 directions.

Or maybe this is what you want. In the code below, A is your image and the result Neighbors(i,j,:) contains all 9 neighbors of A...

Given a point, locate 3 point in different 8 directions.

Or maybe this is what you want. In the code below, A is your image and the result Neighbors(i,j,:) contains all 9 neighbors of A...

5 días ago | 0

Answered

calculate mean in a for loop

No need for loops, Mean_answer=cumsum(data,2)./(1:size(data,2));

calculate mean in a for loop

No need for loops, Mean_answer=cumsum(data,2)./(1:size(data,2));

5 días ago | 0

Answered

Given a point, locate 3 point in different 8 directions.

I'm not sure I understand what the how-to challenge is in the question, but the approach that I think you want is to calculate a...

Given a point, locate 3 point in different 8 directions.

I'm not sure I understand what the how-to challenge is in the question, but the approach that I think you want is to calculate a...

5 días ago | 0

Answered

How can I determine the amount of times a certain value can be achieved by summing values in a matrix?

This solution (EDITED) requires the Optimization Toolbox: LengthVal = [50,50 ,60,70]; %User Input N=numel(LengthVal); X...

How can I determine the amount of times a certain value can be achieved by summing values in a matrix?

This solution (EDITED) requires the Optimization Toolbox: LengthVal = [50,50 ,60,70]; %User Input N=numel(LengthVal); X...

7 días ago | 1

Answered

System of equations: Two different versions of Matlab, with the same script, give different solutions

Seems to me that you are getting the same solutions for each fixed Current level, but presented to you in a different order depe...

System of equations: Two different versions of Matlab, with the same script, give different solutions

Seems to me that you are getting the same solutions for each fixed Current level, but presented to you in a different order depe...

7 días ago | 1

Answered

How to monitor the output of a function when being called in a separate function

You could return fileStr from the file as an output argument and perform whatever tests are needed in the calling workspace, e.g...

How to monitor the output of a function when being called in a separate function

You could return fileStr from the file as an output argument and perform whatever tests are needed in the calling workspace, e.g...

9 días ago | 0

| accepted

Answered

Fitness function increases rather than decreasing with fmincon using hybrid Genetic Algorithm

This might happen if your objective has discontinuities or non-differentiabilities. Such functions are outside the scope of fmin...

Fitness function increases rather than decreasing with fmincon using hybrid Genetic Algorithm

This might happen if your objective has discontinuities or non-differentiabilities. Such functions are outside the scope of fmin...

9 días ago | 0

| accepted

Answered

Can one run fminsearch for a function defined by cases?

Because you are optimizing over a known bounded interval fminbnd is more appropriate: x_optimal = fminbnd(@fun,0,2) function...

Can one run fminsearch for a function defined by cases?

Because you are optimizing over a known bounded interval fminbnd is more appropriate: x_optimal = fminbnd(@fun,0,2) function...

9 días ago | 1

| accepted

Answered

Automatically update attributes of a class ?

This has to go in a file called Rect.m : classdef Rect properties l,b end properties (Depen...

Automatically update attributes of a class ?

This has to go in a file called Rect.m : classdef Rect properties l,b end properties (Depen...

9 días ago | 1

| accepted

Answered

How to pass field values to subclass from superclass?

Your terminolgy is confusing, so I'm not completely sure I understand your question. "Classes" do not have property values. Only...

How to pass field values to subclass from superclass?

Your terminolgy is confusing, so I'm not completely sure I understand your question. "Classes" do not have property values. Only...

9 días ago | 0

Answered

How to use objects of one class in the methods of another class as input?

objc is a Matlab variable like any other, and therefore you can give it as input to a function or class method just like any oth...

How to use objects of one class in the methods of another class as input?

objc is a Matlab variable like any other, and therefore you can give it as input to a function or class method just like any oth...

9 días ago | 0

| accepted

Answered

maximizing a function of 2 variables where coefficients are given by parameters

You can use fminunc, for example, which would do this for you implicitly. Or, you can write down the first order optimality cond...

maximizing a function of 2 variables where coefficients are given by parameters

You can use fminunc, for example, which would do this for you implicitly. Or, you can write down the first order optimality cond...

10 días ago | 0

Answered

Minimizing a scalar value using "fmincon" derived through many variables

Much is unclear from your post including what your unknowns are and how they determine shortprob. However, if S is a function of...

Minimizing a scalar value using "fmincon" derived through many variables

Much is unclear from your post including what your unknowns are and how they determine shortprob. However, if S is a function of...

10 días ago | 1

| accepted