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

Vectorization or for loop (speedup)

Your vectorized code doesn't resemble at all what your for-looped code is computing. The vectorized implementation of your for-l...

Vectorization or for loop (speedup)

Your vectorized code doesn't resemble at all what your for-looped code is computing. The vectorized implementation of your for-l...

8 hours ago | 0

Answered

In nested for-loops, how and where should I set the counting index (indices?) correctly, for doing numerical root-finding using fsolve?

Well, first of all, you would not use fsolve when doing a gridded root search. In general, the search could be done like this: ...

In nested for-loops, how and where should I set the counting index (indices?) correctly, for doing numerical root-finding using fsolve?

Well, first of all, you would not use fsolve when doing a gridded root search. In general, the search could be done like this: ...

12 hours ago | 1

| accepted

Answered

Caclulate Horizonzal Area Between Two Curves And Minimize This Area (Optimization Problem)

The analytical solution to the problem is to take the shift x which maximizes the correlation of C and D https://en.wikipedia.o...

Caclulate Horizonzal Area Between Two Curves And Minimize This Area (Optimization Problem)

The analytical solution to the problem is to take the shift x which maximizes the correlation of C and D https://en.wikipedia.o...

12 hours ago | 0

Answered

how to find the right distance evaluation function of an ellipse

See this related thread, https://www.mathworks.com/matlabcentral/answers/555925-does-anyone-know-how-to-use-the-matlab-to-calcu...

how to find the right distance evaluation function of an ellipse

See this related thread, https://www.mathworks.com/matlabcentral/answers/555925-does-anyone-know-how-to-use-the-matlab-to-calcu...

13 hours ago | 0

Answered

Plot a 2D image in projected coordinate systems.

I do not understand how a 3*10095 matrix is being interpreted as an image. You don't to have any pixel values, as far as I can s...

Plot a 2D image in projected coordinate systems.

I do not understand how a 3*10095 matrix is being interpreted as an image. You don't to have any pixel values, as far as I can s...

14 hours ago | 0

Answered

Configure Matlab to use Python without pyenv

Mario's solution worked!

Configure Matlab to use Python without pyenv

Mario's solution worked!

1 day ago | 0

| accepted

Answered

How to perform logical AND on intervals of contiguous locations

Using group1s from https://www.mathworks.com/matlabcentral/fileexchange/78008-group1s >> xg=group1s(x)+1; >> yg=splitapply(@a...

How to perform logical AND on intervals of contiguous locations

Using group1s from https://www.mathworks.com/matlabcentral/fileexchange/78008-group1s >> xg=group1s(x)+1; >> yg=splitapply(@a...

1 day ago | 0

Answered

How do you create a matrix of matrices?

Put your 10x10x10 arrays in cells https://www.mathworks.com/help/matlab/cell-arrays.html Example: >> A{3,3}=rand(10,10,10) ...

How do you create a matrix of matrices?

Put your 10x10x10 arrays in cells https://www.mathworks.com/help/matlab/cell-arrays.html Example: >> A{3,3}=rand(10,10,10) ...

1 day ago | 0

| accepted

Question

Configure Matlab to use Python without pyenv

I am trying to call Python from Matlab R2019a on a Windows 10 PC. I have Python 3.7 installed under Spyder 3, but Matlab cannot ...

1 day ago | 1 answer | 1

Answered

Sub-matrix Access in a Square Pattern

Using mat2tiles from https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-into-equal-sized-sub-arr...

Sub-matrix Access in a Square Pattern

Using mat2tiles from https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-into-equal-sized-sub-arr...

3 days ago | 0

Answered

Add for each element of a matrix the column vector in another dimension

Hi!i have a matrix 136*136. Call this A. This value is the index of a column of another matrix(24*391) Call this B. Then, re...

Add for each element of a matrix the column vector in another dimension

Hi!i have a matrix 136*136. Call this A. This value is the index of a column of another matrix(24*391) Call this B. Then, re...

3 days ago | 1

| accepted

Answered

local optimisation deterministic optimisation

fvalue = 50 is clearly a better (i.e. lower) objective value than 212.5, so there is every reason to believe that x1=42.5 x2=5...

local optimisation deterministic optimisation

fvalue = 50 is clearly a better (i.e. lower) objective value than 212.5, so there is every reason to believe that x1=42.5 x2=5...

4 days ago | 0

Answered

Failure in initial objective function evaluation. FMINUNC cannot continue. Need some help

You have set SpecifyObjectiveGradient=true, but your objective function code does not provide a second output for your gradient ...

Failure in initial objective function evaluation. FMINUNC cannot continue. Need some help

You have set SpecifyObjectiveGradient=true, but your objective function code does not provide a second output for your gradient ...

4 days ago | 2

Answered

Does Matlab have an off-the-shelf function to generate a 2D circular convolution matrix?

You can use func2mat from https://www.mathworks.com/matlabcentral/fileexchange/44669-func2mat-convert-linear-function-to-matrix...

Does Matlab have an off-the-shelf function to generate a 2D circular convolution matrix?

You can use func2mat from https://www.mathworks.com/matlabcentral/fileexchange/44669-func2mat-convert-linear-function-to-matrix...

4 days ago | 0

Answered

Do numerical solutions depend on lower and upper bounds even when those bounds are not binded?

Changing the bounds affects where the algorithm can search, which can change the sequence of iterations, which can change which ...

Do numerical solutions depend on lower and upper bounds even when those bounds are not binded?

Changing the bounds affects where the algorithm can search, which can change the sequence of iterations, which can change which ...

4 days ago | 1

| accepted

Answered

What is considered good practice for coding up a function's derivatives, e.g. its Jacobian and Hessian matrices?

However, I imagine it's not best practice to continue doing this, especially when I start considering many more variables, and t...

What is considered good practice for coding up a function's derivatives, e.g. its Jacobian and Hessian matrices?

However, I imagine it's not best practice to continue doing this, especially when I start considering many more variables, and t...

4 days ago | 1

| accepted

Answered

How to compute cost function for fmincon?

r=[0.22 9.94 0.08; 0.16 0.95 0.08; 0.07 0.87 0.08]; R = [0.49; 0.42; 0.19]; omega=0.1; gamma=150; fun=@(x) norm( ...

How to compute cost function for fmincon?

r=[0.22 9.94 0.08; 0.16 0.95 0.08; 0.07 0.87 0.08]; R = [0.49; 0.42; 0.19]; omega=0.1; gamma=150; fun=@(x) norm( ...

5 days ago | 1

| accepted

Answered

Dividing 3D image to 3D patches

Using mat2tiles, https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-into-equal-sized-sub-arrays ...

Dividing 3D image to 3D patches

Using mat2tiles, https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-into-equal-sized-sub-arrays ...

6 days ago | 0

| accepted

Answered

How to apply Loop Function to this example

x=x0; for i=1:10 x=M*x; end

How to apply Loop Function to this example

x=x0; for i=1:10 x=M*x; end

6 days ago | 0

| accepted

Answered

Question on GPU Computing

Make sure you have updated drivers and make sure you restart your computer after their installation. Then use gpuDevice() to sel...

Question on GPU Computing

Make sure you have updated drivers and make sure you restart your computer after their installation. Then use gpuDevice() to sel...

6 days ago | 0

Answered

How to find the length of a curve from a list of points using different length scales?

curveLength = sum(vecnorm( diff( [x(:),y(:)] ) ,2,2))

How to find the length of a curve from a list of points using different length scales?

curveLength = sum(vecnorm( diff( [x(:),y(:)] ) ,2,2))

6 days ago | 0

Answered

abcd is efghijk?

function C= circulant(x) n=length(x); C=zeros(n,n); C(1,:)=x; for i=2:n C(i, :)=[C(i-1, n) C(i-1,...

abcd is efghijk?

function C= circulant(x) n=length(x); C=zeros(n,n); C(1,:)=x; for i=2:n C(i, :)=[C(i-1, n) C(i-1,...

8 days ago | 1

Answered

parfor problem (broadcast variable)

There's never any gaurantee parfor will be faster, but I would modify the code as follows, B_Data=A_Data(:,2:5)/(0.6*2); B_ref...

parfor problem (broadcast variable)

There's never any gaurantee parfor will be faster, but I would modify the code as follows, B_Data=A_Data(:,2:5)/(0.6*2); B_ref...

8 days ago | 0

Answered

Use inpolygon command for multiple polygon areas

Use discretize(), https://www.mathworks.com/help/matlab/ref/double.discretize.html Apply it separately to all of your xv's and...

Use inpolygon command for multiple polygon areas

Use discretize(), https://www.mathworks.com/help/matlab/ref/double.discretize.html Apply it separately to all of your xv's and...

8 days ago | 0

Answered

For loop and array type

Best guess - your loop has reached a z for which allcsvfiles{z,1}(:,4) contains text. Use dbstop() to check.

For loop and array type

Best guess - your loop has reached a z for which allcsvfiles{z,1}(:,4) contains text. Use dbstop() to check.

8 days ago | 0

Answered

Array of Structures (not structure array)

I don't know if this is something you explored in (2), but if so, I don't see why it wouldn't cover what you are trying to do. ...

Array of Structures (not structure array)

I don't know if this is something you explored in (2), but if so, I don't see why it wouldn't cover what you are trying to do. ...

8 days ago | 0

Answered

Memory cost of multiplying sparse matrices

Here's another customized multiplication routine for tall A. I do not know how it compares to Bruno's in terms of speed, but it ...

Memory cost of multiplying sparse matrices

Here's another customized multiplication routine for tall A. I do not know how it compares to Bruno's in terms of speed, but it ...

10 days ago | 0

Answered

Memory cost of multiplying sparse matrices

I believe it is simply because Matlab sparse matrix routines don't handle very tall & thin matrix dimensions very well. It beco...

Memory cost of multiplying sparse matrices

I believe it is simply because Matlab sparse matrix routines don't handle very tall & thin matrix dimensions very well. It beco...

11 days ago | 0

| accepted