5 952 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

Is my code correct for finding the distance between a point and a surface?

It's largely correct, except that your function distsq is not differentiable at x=0. So, if there's a chance the solution might ...

Is my code correct for finding the distance between a point and a surface?

It's largely correct, except that your function distsq is not differentiable at x=0. So, if there's a chance the solution might ...

ungefär 5 timmar ago | 1

| accepted

Answered

Setting a Value in an Array in a Class

Use an ordinary method: classdef myclass_t properties my_array double end methods functi...

Setting a Value in an Array in a Class

Use an ordinary method: classdef myclass_t properties my_array double end methods functi...

ungefär 7 timmar ago | 1

Answered

How to solve linear equation for 3 unkowns using SOR in GPU

If you have the Parallel Computing Toolbox, you can make all the variables in your SORstep function A,B,C,D,E,F,G,H,I,J,K,L,om...

How to solve linear equation for 3 unkowns using SOR in GPU

If you have the Parallel Computing Toolbox, you can make all the variables in your SORstep function A,B,C,D,E,F,G,H,I,J,K,L,om...

ungefär 14 timmar ago | 0

Answered

Index in position 2 exceeds array bounds?

No, it is because of this line, ymax = max(n,j+1); %should be min But I agree with Rik that medfilt2 makes much more sense her...

Index in position 2 exceeds array bounds?

No, it is because of this line, ymax = max(n,j+1); %should be min But I agree with Rik that medfilt2 makes much more sense her...

ungefär 16 timmar ago | 1

Answered

Over-all sum value in fmincon for multiple x

Are you sure you only have 6 unknowns? In your earlier post, you had more. https://www.mathworks.com/matlabcentral/answers/4802...

Over-all sum value in fmincon for multiple x

Are you sure you only have 6 unknowns? In your earlier post, you had more. https://www.mathworks.com/matlabcentral/answers/4802...

ungefär 16 timmar ago | 0

| accepted

Answered

How to fix the error (Index exceeds matrix dimensions)?

V and W only have a single column, but you are indexing them V(:,j) and W(:,j) at j>1.

How to fix the error (Index exceeds matrix dimensions)?

V and W only have a single column, but you are indexing them V(:,j) and W(:,j) at j>1.

ungefär 16 timmar ago | 0

Answered

round off problem in matlab

The values are not changed. They are just displayed to the screen to 4 decimal points. Use format long to see more precision. Al...

round off problem in matlab

The values are not changed. They are just displayed to the screen to 4 decimal points. Use format long to see more precision. Al...

ungefär 16 timmar ago | 0

Answered

Accessing structure by its name and looping through it

Why not organize the data as a struct array? Tests(1).Time = data1; Tests(1).Speed = data2; Tests(2).Time = data3; Tests(2...

Accessing structure by its name and looping through it

Why not organize the data as a struct array? Tests(1).Time = data1; Tests(1).Speed = data2; Tests(2).Time = data3; Tests(2...

ungefär 17 timmar ago | 1

| accepted

Answered

How to solve linear equation for 3 unkowns using SOR in GPU

Not sure why you would be using an iterative method when an analytical solution is available. A=gpuArray.rand(3,3,512^2); b=gp...

How to solve linear equation for 3 unkowns using SOR in GPU

Not sure why you would be using an iterative method when an analytical solution is available. A=gpuArray.rand(3,3,512^2); b=gp...

en dag ago | 0

Answered

How to match an image subset in an image?

This might be applicable, https://www.mathworks.com/matlabcentral/fileexchange/33340-wncc-weighted-normalized-cross-correlation...

How to match an image subset in an image?

This might be applicable, https://www.mathworks.com/matlabcentral/fileexchange/33340-wncc-weighted-normalized-cross-correlation...

en dag ago | 1

Answered

Find minimum of an n variable function, n is like 800+

Depends on the surface. It's trivial, for example, if the surface is a hyperplane or a hypersphere.

Find minimum of an n variable function, n is like 800+

Depends on the surface. It's trivial, for example, if the surface is a hyperplane or a hypersphere.

en dag ago | 1

Answered

manipulation of (too) huge matrix (beyond the calculation capacity of my computer)

Actually, I am only interested in combinaison for which the addition of MllA+MllB are between 427.92105 and 428.49755 If you ha...

manipulation of (too) huge matrix (beyond the calculation capacity of my computer)

Actually, I am only interested in combinaison for which the addition of MllA+MllB are between 427.92105 and 428.49755 If you ha...

en dag ago | 0

| accepted

Answered

Error in fitting two parameters with lsqnonlin

[curve_fit_parameters,RESNORM,RESIDUAL,EXITFLAG,OUTPUT,LAMBDA,JACOBIAN] = ... lsqnonlin(@(k) fitcrit(k,time_exp, conc_exp, pa...

Error in fitting two parameters with lsqnonlin

[curve_fit_parameters,RESNORM,RESIDUAL,EXITFLAG,OUTPUT,LAMBDA,JACOBIAN] = ... lsqnonlin(@(k) fitcrit(k,time_exp, conc_exp, pa...

en dag ago | 0

| accepted

Answered

Mathworks Questions Resolved.

You should see a button next to the Answer allowing you to accept it. You can also Upvote the answer to award the answerer extra...

Mathworks Questions Resolved.

You should see a button next to the Answer allowing you to accept it. You can also Upvote the answer to award the answerer extra...

en dag ago | 0

| accepted

Answered

Finish lines in the image

Here is another method based on interpolation, and faster than dilating with large strels. [m,n]=size(A); [I,J]=find(bwskel(...

Finish lines in the image

Here is another method based on interpolation, and faster than dilating with large strels. [m,n]=size(A); [I,J]=find(bwskel(...

en dag ago | 1

Answered

Calling vectors from a user defined function?

You are missing a multiplication operator after the 2 in line 15.

Calling vectors from a user defined function?

You are missing a multiplication operator after the 2 in line 15.

2 dagar ago | 1

Answered

Steepest descent method algorithm

alpha is too big. Try alpha=0.001.

Steepest descent method algorithm

alpha is too big. Try alpha=0.001.

2 dagar ago | 1

| accepted

Answered

Image processing and sub-array summation

You can use sepblockfun from the File Exchange https://www.mathworks.com/matlabcentral/fileexchange/48089-separable-block-wise-...

Image processing and sub-array summation

You can use sepblockfun from the File Exchange https://www.mathworks.com/matlabcentral/fileexchange/48089-separable-block-wise-...

2 dagar ago | 1

Answered

Finish lines in the image

Perhaps as follows, gapsize=36; A=imcrop(rgb2gray(imread('image.png'))); B=(imdilate(A,strel('sphere',ceil(gapsize...

Finish lines in the image

Perhaps as follows, gapsize=36; A=imcrop(rgb2gray(imread('image.png'))); B=(imdilate(A,strel('sphere',ceil(gapsize...

2 dagar ago | 2

Answered

Optimization expression operation not supported

Maybe this is what you intended, C=cashFlows*bonds-obligations; E=C.'*triu(ones(8)); ALM.Constraints.Const1 = (E.*(1+Rates)')...

Optimization expression operation not supported

Maybe this is what you intended, C=cashFlows*bonds-obligations; E=C.'*triu(ones(8)); ALM.Constraints.Const1 = (E.*(1+Rates)')...

2 dagar ago | 0

| accepted

Answered

How to deblur an image after gauss filter and image registration?

Use imregtform to perform the registration on the blurred images and to obtain the optimal tform. Then apply the tform to your o...

How to deblur an image after gauss filter and image registration?

Use imregtform to perform the registration on the blurred images and to obtain the optimal tform. Then apply the tform to your o...

3 dagar ago | 0

Answered

How to find the (x,y) combinations that make z=0?

You can use fimplicit https://www.mathworks.com/help/matlab/ref/fimplicit.html

How to find the (x,y) combinations that make z=0?

You can use fimplicit https://www.mathworks.com/help/matlab/ref/fimplicit.html

3 dagar ago | 0

Answered

Plotting a for loop

C=nan(1,101); F=C; %preallocate for i = 0:100; C(i+1) = i; F(i+1) = (i*1.8)+32; end plot (C,F) xlabel(...

Plotting a for loop

C=nan(1,101); F=C; %preallocate for i = 0:100; C(i+1) = i; F(i+1) = (i*1.8)+32; end plot (C,F) xlabel(...

3 dagar ago | 0

Answered

fsolve with functions inside script

A=3; B=2; x0=1; fsolve(@(x)fun(A,B,x) ,x0); function F=fun(A,B,x) A=A; B=B; F=A+B/x end

fsolve with functions inside script

A=3; B=2; x0=1; fsolve(@(x)fun(A,B,x) ,x0); function F=fun(A,B,x) A=A; B=B; F=A+B/x end

3 dagar ago | 0

Answered

Find the cell index in a nested cell array, corresponding to a string (by using strcmp)

B=cellfun(@(x) strcmp(x, 'BLUE'), A, 'UniformOutput', false); cellfun(@(c) any(c(:)), B)

Find the cell index in a nested cell array, corresponding to a string (by using strcmp)

B=cellfun(@(x) strcmp(x, 'BLUE'), A, 'UniformOutput', false); cellfun(@(c) any(c(:)), B)

3 dagar ago | 1

| accepted

Answered

Remove rows in variable dimension

idx=repmat({':'},1,ndims(M)); idx{dim}=1:size(M,dim)-N; M2=M(idx{:})

Remove rows in variable dimension

idx=repmat({':'},1,ndims(M)); idx{dim}=1:size(M,dim)-N; M2=M(idx{:})

3 dagar ago | 0

| accepted

Answered

How to set up the following optimisaiton witth quadprog?

You haven't shown any constraints. Are you sure you couldn't just use lscov? If you do have constraints, I think lsqlin would b...

How to set up the following optimisaiton witth quadprog?

You haven't shown any constraints. Are you sure you couldn't just use lscov? If you do have constraints, I think lsqlin would b...

3 dagar ago | 0

| accepted

Answered

Error using horzcat Dimensions of matrices being concatenated are not consistent.

I suspect it is because y is a column vector, whereas you intended it to be a row vector. You should run the code with "Pause on...

Error using horzcat Dimensions of matrices being concatenated are not consistent.

I suspect it is because y is a column vector, whereas you intended it to be a row vector. You should run the code with "Pause on...

3 dagar ago | 0

Answered

object detection in a binary image

>> bwimage=imbinarize(rgb2gray(imread('bwimage.jpg'))); >> locations=regionprops('table',~bwimage,'Centroid') locations = ...

object detection in a binary image

>> bwimage=imbinarize(rgb2gray(imread('bwimage.jpg'))); >> locations=regionprops('table',~bwimage,'Centroid') locations = ...

6 dagar ago | 0

| accepted