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

Parfor: Converting broadcast variables into temporary variables or sliced variables

Temporary variables are not sent to the workers. They are created on the workers (and are destroyed there).

Parfor: Converting broadcast variables into temporary variables or sliced variables

Temporary variables are not sent to the workers. They are created on the workers (and are destroyed there).

environ 4 heures ago | 0

Answered

Change the first half of consecutive 1 in a column into 2

map=(A==1); C=cumsum(map,1,'omitnan'); A( C<=C(end,:)/2 & map) = 2;

Change the first half of consecutive 1 in a column into 2

map=(A==1); C=cumsum(map,1,'omitnan'); A( C<=C(end,:)/2 & map) = 2;

environ 9 heures ago | 0

| accepted

Answered

Neighbour voxels of a list of voxels

If you have lists of xCoordinates, yCoordinates, and zCoordinates of the voxels, you may simply do, [dx,dy,dz]=ndgrid([-1,0,1])...

Neighbour voxels of a list of voxels

If you have lists of xCoordinates, yCoordinates, and zCoordinates of the voxels, you may simply do, [dx,dy,dz]=ndgrid([-1,0,1])...

environ 14 heures ago | 0

Answered

Optimizing a function with a vector as input

There is no reason why an OptimizationVariable can't be vector-valued, e.g., P=optimvar('P',[6,1]); size(P)

Optimizing a function with a vector as input

There is no reason why an OptimizationVariable can't be vector-valued, e.g., P=optimvar('P',[6,1]); size(P)

environ 14 heures ago | 0

Answered

fastest way for multiplication of symmetric matrix and sparse matrix

If I use sparse matrix for A, the time to calculate A*P*A' is twice as if I use dense matrix for A. You have a strange compute...

fastest way for multiplication of symmetric matrix and sparse matrix

If I use sparse matrix for A, the time to calculate A*P*A' is twice as if I use dense matrix for A. You have a strange compute...

environ 15 heures ago | 0

| accepted

Answered

The Convolution Theorem in 2D

The problem is that you need to zero-pad, A=rand(10); B=rand(10); szA=size(A); szB=size(B); szFull=szA+szB-1; result1 =...

The Convolution Theorem in 2D

The problem is that you need to zero-pad, A=rand(10); B=rand(10); szA=size(A); szB=size(B); szFull=szA+szB-1; result1 =...

1 jour ago | 1

Question

Create listener for changes in position of a figure window

I have been trying to use addlistener() to make it so that when one figure window is moved, another figure window shifts positi...

1 jour ago | 1 answer | 0

Answered

How to see a 3D matrix with another point of view

Perhaps the view() command? https://www.mathworks.com/help/matlab/ref/view.html

How to see a 3D matrix with another point of view

Perhaps the view() command? https://www.mathworks.com/help/matlab/ref/view.html

1 jour ago | 0

| accepted

Answered

Converting a function into an operator

A shortcut might be to use my MatrixObj class https://www.mathworks.com/matlabcentral/fileexchange/26611-on-the-fly-definition-...

Converting a function into an operator

A shortcut might be to use my MatrixObj class https://www.mathworks.com/matlabcentral/fileexchange/26611-on-the-fly-definition-...

1 jour ago | 0

Answered

Matrix to string, filled with zeros

B=compose('%.4d',A); C=cumsum( A(2:end)==0 & A(1:end-1)==9999 );

Matrix to string, filled with zeros

B=compose('%.4d',A); C=cumsum( A(2:end)==0 & A(1:end-1)==9999 );

1 jour ago | 2

Answered

How to produce frequency vector corresponding to FFT() samples?

[X,freqvec] = DFT(x,Fs); plot(freqvec,abs(X)) function [X,freqvec] = DFT(x,Fs) N = length(x); for k = 0:(N-1)...

How to produce frequency vector corresponding to FFT() samples?

[X,freqvec] = DFT(x,Fs); plot(freqvec,abs(X)) function [X,freqvec] = DFT(x,Fs) N = length(x); for k = 0:(N-1)...

1 jour ago | 1

Answered

Optimally search for which positions a rectangle is within a polygon, faster way than using shapeID of union?

If the red shape is fixed and you want to do this test for a swarm of blue rectangles, a good strategy may be to decompose the r...

Optimally search for which positions a rectangle is within a polygon, faster way than using shapeID of union?

If the red shape is fixed and you want to do this test for a swarm of blue rectangles, a good strategy may be to decompose the r...

1 jour ago | 1

Answered

Is there a Multivariate PCHIP?

It will be somewhat faster to use griddedInterpolant() rather than interpn().

Is there a Multivariate PCHIP?

It will be somewhat faster to use griddedInterpolant() rather than interpn().

2 jours ago | 1

| accepted

Answered

Not enough input arguments when i call fmincon constraint function with multiple input parameters to pass into

The constraint and objective functions should have one input argument. If you have N unknowns, they should be passed in as an N-...

Not enough input arguments when i call fmincon constraint function with multiple input parameters to pass into

The constraint and objective functions should have one input argument. If you have N unknowns, they should be passed in as an N-...

3 jours ago | 1

| accepted

Answered

How can I find exactly the coordinates of the center of the yellow circle?

regionprops3( true(size(yourImage)) ,yourImage, 'WeightedCentroid')

How can I find exactly the coordinates of the center of the yellow circle?

regionprops3( true(size(yourImage)) ,yourImage, 'WeightedCentroid')

3 jours ago | 2

Answered

How to find the volume of a region in a segmented image?

stats = regionprops3(segmentationMap,'Volume')

How to find the volume of a region in a segmented image?

stats = regionprops3(segmentationMap,'Volume')

4 jours ago | 0

Answered

Determine three model Parameters (least squares?)

lsqcurvefit would be appropriate, https://www.mathworks.com/help/optim/ug/lsqcurvefit.html

Determine three model Parameters (least squares?)

lsqcurvefit would be appropriate, https://www.mathworks.com/help/optim/ug/lsqcurvefit.html

4 jours ago | 0

| accepted

Answered

Non linear fit of multiple data set

Because of the constraints, I think you'll just have to do it by Monte Carlo simulation...

Non linear fit of multiple data set

Because of the constraints, I think you'll just have to do it by Monte Carlo simulation...

4 jours ago | 0

Answered

TD convolution versus FD multiplication

Remember, linear convolution is not the same as cyclic convolution. Make sure you do appropriate zero padding, e.g., x=rand(1,5...

TD convolution versus FD multiplication

Remember, linear convolution is not the same as cyclic convolution. Make sure you do appropriate zero padding, e.g., x=rand(1,5...

4 jours ago | 0

Answered

How to take cross product of two 2D vector fields

result(:,:,3)=Ax.*By-Ay.*Bx;

How to take cross product of two 2D vector fields

result(:,:,3)=Ax.*By-Ay.*Bx;

4 jours ago | 1

| accepted

Answered

How to find shortest path length by adjacency matrix?

Use the adjacency matrix A to create a graph object, and then use the distances() command. https://www.mathworks.com/help/matla...

How to find shortest path length by adjacency matrix?

Use the adjacency matrix A to create a graph object, and then use the distances() command. https://www.mathworks.com/help/matla...

5 jours ago | 0

| accepted

Answered

Create single columns of elementwise means

DF=mean(X_dark ,2); FF=mean(X_flat ,2); X_corrected=(X_proj-DF)./(FF-DF);

Create single columns of elementwise means

DF=mean(X_dark ,2); FF=mean(X_flat ,2); X_corrected=(X_proj-DF)./(FF-DF);

5 jours ago | 0

| accepted

Answered

How to convert a matrix into some cells?

You can use mat2tiles, which you must Download. A=[1 0 ; 23 13; 1 9; 4 6; 7 13; 0 32]; Acell = m...

How to convert a matrix into some cells?

You can use mat2tiles, which you must Download. A=[1 0 ; 23 13; 1 9; 4 6; 7 13; 0 32]; Acell = m...

5 jours ago | 0

| accepted

Answered

Put formula into quadprog

That would be, A=[]; b=[]; Aeq=[]; beq=[]; lb=zeros(1,numel(z)); and,

Put formula into quadprog

That would be, A=[]; b=[]; Aeq=[]; beq=[]; lb=zeros(1,numel(z)); and,

5 jours ago | 0

| accepted

Answered

Solving system non-linear equations

You could do a numerical grid search using ndgrid to see where if anywhere, the approximate roots lie within a broad set of boun...

Solving system non-linear equations

You could do a numerical grid search using ndgrid to see where if anywhere, the approximate roots lie within a broad set of boun...

5 jours ago | 0

| accepted

Answered

Generating adjacency matrix for following network

Perhaps as follows, n=6; T=nan(n,2); map=isnan(T); while any(map(:)) [i,~]=find(map,1); if ~map(i...

Generating adjacency matrix for following network

Perhaps as follows, n=6; T=nan(n,2); map=isnan(T); while any(map(:)) [i,~]=find(map,1); if ~map(i...

5 jours ago | 0

Answered

Extending a 2D lattice of points

You can use scatteredInterpolant() or griddata().

Extending a 2D lattice of points

You can use scatteredInterpolant() or griddata().

6 jours ago | 0

Answered

Fmincon - Variable dependent constraints

If you wish, you can download prob2matrices() and use the problem-based framework to help set up the linear constraints. x=opti...

Fmincon - Variable dependent constraints

If you wish, you can download prob2matrices() and use the problem-based framework to help set up the linear constraints. x=opti...

6 jours ago | 1

Answered

Tridiagonal Matrix with subdiagonal and main diagonal is also matrix

Here's another way, probably much faster. N=1000; a1=4;b1=-1; A =diag(a1*ones(1,N-1)) + diag(b1*ones(1,N-2),1) + diag(b1...

Tridiagonal Matrix with subdiagonal and main diagonal is also matrix

Here's another way, probably much faster. N=1000; a1=4;b1=-1; A =diag(a1*ones(1,N-1)) + diag(b1*ones(1,N-2),1) + diag(b1...

6 jours ago | 0