5.522 total contributions since 2009

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

Conditional function on matrix

vals=[1,10,5]; Kd=vals( discretize(Kt,[-inf,0.2,1.09*c2,+inf]) );

Conditional function on matrix

vals=[1,10,5]; Kd=vals( discretize(Kt,[-inf,0.2,1.09*c2,+inf]) );

ongeveer 10 uur ago | 0

Answered

HELP DIFFERENT LINESTYLE ON THE SAME CURVE

Just split x,y into two subsets and plot each subset as a separate line: idx=x<50; x1=x(idx); y1=y(idx); x2=x(~idx); y2=y(~id...

HELP DIFFERENT LINESTYLE ON THE SAME CURVE

Just split x,y into two subsets and plot each subset as a separate line: idx=x<50; x1=x(idx); y1=y(idx); x2=x(~idx); y2=y(~id...

ongeveer 10 uur ago | 0

| accepted

Answered

Convert cell arrays to 4-D array

Where C is your cell array: M = reshape( cat(3,C{:}) , [256,256,10,35]) EDIT: Or M = reshape( cat(3,C{:}) , [256,256,35,10...

Convert cell arrays to 4-D array

Where C is your cell array: M = reshape( cat(3,C{:}) , [256,256,10,35]) EDIT: Or M = reshape( cat(3,C{:}) , [256,256,35,10...

ongeveer 15 uur ago | 0

| accepted

Answered

Ax=b question

You could use intlinprog. Assuming WNLOG that the manipulated b value is b(1), N=numel(b); f=[-1,zeros(1,N)].'; Aeq=[+100*f...

Ax=b question

You could use intlinprog. Assuming WNLOG that the manipulated b value is b(1), N=numel(b); f=[-1,zeros(1,N)].'; Aeq=[+100*f...

1 dag ago | 0

Answered

Cross Product of an Array

This way avoids repmatting, which may be desirable when N is large. M = your 3xN matrix v = your 3x1 vector result=xprodmat...

Cross Product of an Array

This way avoids repmatting, which may be desirable when N is large. M = your 3xN matrix v = your 3x1 vector result=xprodmat...

1 dag ago | 0

Answered

expectation of random numbers

You can't do it. The D(i) are statistically independent, and so offer no information about what comes next.

expectation of random numbers

You can't do it. The D(i) are statistically independent, and so offer no information about what comes next.

1 dag ago | 0

Answered

I keep getting the message: Unbalanced or unexpected parenthesis or bracket. How would I fix it? I'm trying to solve for the maximum and minimum with a function and it's constraint.

The error message tells you where to look: Line: 11 Column: 21

I keep getting the message: Unbalanced or unexpected parenthesis or bracket. How would I fix it? I'm trying to solve for the maximum and minimum with a function and it's constraint.

The error message tells you where to look: Line: 11 Column: 21

1 dag ago | 0

Answered

How can I mean multiple matrices, element by element in a n*n cell array?

If I call your cell array C, M=cell2mat(reshape(C,1,16,[])); result = mean(M,2)

How can I mean multiple matrices, element by element in a n*n cell array?

If I call your cell array C, M=cell2mat(reshape(C,1,16,[])); result = mean(M,2)

2 dagen ago | 0

| accepted

Answered

Failure in initial objective function evaluation. FSOLVE cannot continue.

Instead of XN, in this line F(1) = Xn2 + Xo2 + Xo + XN + Xno - 1; should it be Xn?

Failure in initial objective function evaluation. FSOLVE cannot continue.

Instead of XN, in this line F(1) = Xn2 + Xo2 + Xo + XN + Xno - 1; should it be Xn?

5 dagen ago | 0

| accepted

Answered

How to compute the homography

tform = projective2d(H); newImage = imwarp(oldImage,tform);

How to compute the homography

tform = projective2d(H); newImage = imwarp(oldImage,tform);

5 dagen ago | 1

Answered

What is lambda in lsqcurvefit?

The lambda returned by lsqcurvefit are not Levenberg-Marquardt parameters. They are the Lagrange multiplers at the solution. If ...

What is lambda in lsqcurvefit?

The lambda returned by lsqcurvefit are not Levenberg-Marquardt parameters. They are the Lagrange multiplers at the solution. If ...

5 dagen ago | 0

| accepted

Answered

How fmincon shifts x0 when it does not strictly satisfy the upper and lower bounds?

I don't know precisely how the shifting algorithm works, but I think it's safe to assume that it is independent of the objective...

How fmincon shifts x0 when it does not strictly satisfy the upper and lower bounds?

I don't know precisely how the shifting algorithm works, but I think it's safe to assume that it is independent of the objective...

6 dagen ago | 0

Answered

Find matrix rows that have 3 common values, store the rows and the values

I'll call your original 5 column matrix A. D=cell(4,1); a5=A(:,5); As=sort(A(:,1:4),2); for i=1:4 %small loop ...

Find matrix rows that have 3 common values, store the rows and the values

I'll call your original 5 column matrix A. D=cell(4,1); a5=A(:,5); As=sort(A(:,1:4),2); for i=1:4 %small loop ...

7 dagen ago | 0

| accepted

Answered

fminunc stopped because it cannot decrease the objective function along the current search direction.

You will need to use a dedicated function for computing the log-sigmoid. Combining log and sigmoid as separate functions is nume...

fminunc stopped because it cannot decrease the objective function along the current search direction.

You will need to use a dedicated function for computing the log-sigmoid. Combining log and sigmoid as separate functions is nume...

7 dagen ago | 0

Answered

Issues in Matrix multiplication

A somewhat less efficient solution (but which uses no 3rd party files) is, A=rand(6,6,100); B=rand(6,1,100); C=sum( A.*reshap...

Issues in Matrix multiplication

A somewhat less efficient solution (but which uses no 3rd party files) is, A=rand(6,6,100); B=rand(6,1,100); C=sum( A.*reshap...

7 dagen ago | 1

Answered

Issues in Matrix multiplication

Use mtimesx from the File Exchange https://www.mathworks.com/matlabcentral/fileexchange/25977-mtimesx-fast-matrix-multiply-with...

Issues in Matrix multiplication

Use mtimesx from the File Exchange https://www.mathworks.com/matlabcentral/fileexchange/25977-mtimesx-fast-matrix-multiply-with...

7 dagen ago | 0

Answered

Extract rectangular grid from triangulation

I think you are looking for griddata().

Extract rectangular grid from triangulation

I think you are looking for griddata().

8 dagen ago | 0

Answered

How do I get the mean of always 4 columns

One way is using sepblockfun, downloadable from here https://www.mathworks.com/matlabcentral/fileexchange/48089-separable-block...

How do I get the mean of always 4 columns

One way is using sepblockfun, downloadable from here https://www.mathworks.com/matlabcentral/fileexchange/48089-separable-block...

8 dagen ago | 0

Answered

Compute an Orthogonal Matrix

No, this is generally not possible. When all the eigenvalues of A are distinct, for example, the (orthonormalized) eigenvectors ...

Compute an Orthogonal Matrix

No, this is generally not possible. When all the eigenvalues of A are distinct, for example, the (orthonormalized) eigenvectors ...

9 dagen ago | 0

Answered

How to calculate covariace of two random variable

cov(x(:),y(:))

How to calculate covariace of two random variable

cov(x(:),y(:))

9 dagen ago | 0

| accepted

Answered

how i can find these branching point

[I,J] = find(binaryimg<max(binaryimg(:))/2); IJ = [I,J]; [~,idx] = min(IJ*[1 1; -1 1; 1 -1; -1 -1].'); Corners = IJ(idx,:); ...

how i can find these branching point

[I,J] = find(binaryimg<max(binaryimg(:))/2); IJ = [I,J]; [~,idx] = min(IJ*[1 1; -1 1; 1 -1; -1 -1].'); Corners = IJ(idx,:); ...

9 dagen ago | 0

Answered

I am trying to find the corners of the "rectangular" shapes. This code is working very well. But I dont know exactly how it works. Can you explain me ??

Maybe this image will help. The corners of a polyhedron will maximize/minimize the intercept of lines of a certain slope - it's ...

I am trying to find the corners of the "rectangular" shapes. This code is working very well. But I dont know exactly how it works. Can you explain me ??

Maybe this image will help. The corners of a polyhedron will maximize/minimize the intercept of lines of a certain slope - it's ...

9 dagen ago | 0

| accepted

Answered

Create a free cubic spline that passes some certain points

The spline command would be one way https://www.mathworks.com/help/matlab/ref/spline.html

Create a free cubic spline that passes some certain points

The spline command would be one way https://www.mathworks.com/help/matlab/ref/spline.html

9 dagen ago | 0

Answered

values of equation in last iteration in fmincon

The computation of xw1 is a trivial one-liner. Just compute it separately from the optimal X given to you by fmincon, xw1=sum( ...

values of equation in last iteration in fmincon

The computation of xw1 is a trivial one-liner. Just compute it separately from the optimal X given to you by fmincon, xw1=sum( ...

9 dagen ago | 0

Answered

Overlaying and Comparing Two Sets of Co-Ordinates

I haven't used it myself, but this implementation of Iterative Closest Point seems pretty popular https://www.mathworks.com/mat...

Overlaying and Comparing Two Sets of Co-Ordinates

I haven't used it myself, but this implementation of Iterative Closest Point seems pretty popular https://www.mathworks.com/mat...

9 dagen ago | 0

Answered

two conditions on two 8*256 matrices

There are lots of knapsack problem solvers on the File Exchange https://www.mathworks.com/matlabcentral/fileexchange?q=knapsack...

two conditions on two 8*256 matrices

There are lots of knapsack problem solvers on the File Exchange https://www.mathworks.com/matlabcentral/fileexchange?q=knapsack...

10 dagen ago | 0

Answered

Combining cells within a cell array that have intersecting values

You should just represent your shapes as polyshape objects. Then it is easy to weed out redundant vertices using the simplify()...

Combining cells within a cell array that have intersecting values

You should just represent your shapes as polyshape objects. Then it is easy to weed out redundant vertices using the simplify()...

11 dagen ago | 1

| accepted

Answered

Curve fitting & Plotting On Logarithmic y, linear x

You can change the scale of the plot from linear to log just by doing hAx.YScale='log'; where hAx is a handle to your axis.

Curve fitting & Plotting On Logarithmic y, linear x

You can change the scale of the plot from linear to log just by doing hAx.YScale='log'; where hAx is a handle to your axis.

11 dagen ago | 0

Answered

Skip empty array in plot legend?

Why not something like this? allLines=[a,b,c,d]; allStrings={'blue line', 'level1', 'level2', 'exceed const lims'}; leg...

Skip empty array in plot legend?

Why not something like this? allLines=[a,b,c,d]; allStrings={'blue line', 'level1', 'level2', 'exceed const lims'}; leg...

12 dagen ago | 0