6,171 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 possible configure matlab to get a+[ ]=a?

You could also replace your plus() operations with sum() operations. Compare: >> a=3; b=[]; >> a+b ans = [] >>...

Is possible configure matlab to get a+[ ]=a?

You could also replace your plus() operations with sum() operations. Compare: >> a=3; b=[]; >> a+b ans = [] >>...

1 day ago | 1

Answered

Is possible configure matlab to get a+[ ]=a?

No way that you're going like. You could subclass Matlab's double type https://www.mathworks.com/help/matlab/matlab_oop/extend-...

Is possible configure matlab to get a+[ ]=a?

No way that you're going like. You could subclass Matlab's double type https://www.mathworks.com/help/matlab/matlab_oop/extend-...

1 day ago | 1

Answered

Error using griddedInterpolant The grid vectors do not define a grid of points that match the given values.

You have 20 Y samples, but your V has 21 rows. >> whos X Y V Name Size Bytes Class Attributes V ...

Error using griddedInterpolant The grid vectors do not define a grid of points that match the given values.

You have 20 Y samples, but your V has 21 rows. >> whos X Y V Name Size Bytes Class Attributes V ...

1 day ago | 0

| accepted

Answered

Average of every nth value in a vector

tmp=conv(yourvector, ones(600,1)/600,'valid'); result=tmp(1:600:end)

Average of every nth value in a vector

tmp=conv(yourvector, ones(600,1)/600,'valid'); result=tmp(1:600:end)

1 day ago | 0

Answered

3-D line of best fit from origin to cloud of data points

The equation is t*u where u is 3D line direction vector obtained by, [V,d]=eig(A.'*A,'vector'); [~,i]=max(d); u=V(:,i); and ...

3-D line of best fit from origin to cloud of data points

The equation is t*u where u is 3D line direction vector obtained by, [V,d]=eig(A.'*A,'vector'); [~,i]=max(d); u=V(:,i); and ...

2 days ago | 0

Answered

Multi-function optimization

You would need something like the following, options=optimoptions(@fminunc,'SpecifyObjectiveGradient', true); allX = fminunc...

Multi-function optimization

You would need something like the following, options=optimoptions(@fminunc,'SpecifyObjectiveGradient', true); allX = fminunc...

2 days ago | 0

| accepted

Answered

2D Convex Hull: I can't think of a 'criteria' to filter out the 'wrong' points, please help!

One thing you can also try to do is find where one of the rays from the pivot point lies inside the triangle formed by its two n...

2D Convex Hull: I can't think of a 'criteria' to filter out the 'wrong' points, please help!

One thing you can also try to do is find where one of the rays from the pivot point lies inside the triangle formed by its two n...

2 days ago | 0

Answered

I am calculating membrane water flux using fsolve but MATLAB gave me a negative value of water flux (Jw) as follows. I don't know how to avoid these negative solution from non-linear equation so I would like to know how to solve it correctly

Since you only have single unknown, you should probably use fzero. With fzero you can specify a bounded interval within which to...

I am calculating membrane water flux using fsolve but MATLAB gave me a negative value of water flux (Jw) as follows. I don't know how to avoid these negative solution from non-linear equation so I would like to know how to solve it correctly

Since you only have single unknown, you should probably use fzero. With fzero you can specify a bounded interval within which to...

2 days ago | 0

Answered

Radon Transform Documentation Matlab

I understand the Radon Transform get the product between the length(intersection) of each beam through the pixel and the pixel ...

Radon Transform Documentation Matlab

I understand the Radon Transform get the product between the length(intersection) of each beam through the pixel and the pixel ...

3 days ago | 1

Answered

Why do the values not get added into the array such as [2,3,5,7], but instead they get summed up?

Because you are using '+'. To concatenate, you would do, values = [values, tester];

Why do the values not get added into the array such as [2,3,5,7], but instead they get summed up?

Because you are using '+'. To concatenate, you would do, values = [values, tester];

3 days ago | 0

| accepted

Answered

Cloud of points Convex Hull

See convhull or convhulln https://www.mathworks.com/help/matlab/ref/convhull.html https://www.mathworks.com/help/matlab/ref/co...

Cloud of points Convex Hull

See convhull or convhulln https://www.mathworks.com/help/matlab/ref/convhull.html https://www.mathworks.com/help/matlab/ref/co...

3 days ago | 0

Answered

Using one variable containing all name-value pairs for built-in Matlab functions

See inputParser https://www.mathworks.com/help/matlab/ref/inputparser.html which by default will expand structures into Name-V...

Using one variable containing all name-value pairs for built-in Matlab functions

See inputParser https://www.mathworks.com/help/matlab/ref/inputparser.html which by default will expand structures into Name-V...

3 days ago | 0

| accepted

Answered

How can i find a certain vector in a matrix?

[~,loc]=ismember(vector.',Matrix.','rows');

How can i find a certain vector in a matrix?

[~,loc]=ismember(vector.',Matrix.','rows');

3 days ago | 1

Answered

How to make difference between two cell array?

fun=@(c) num2str(c,'%.20d '); A=cellfun(fun,NS,'uni',0); B=cellfun(fun,setL,'uni',0); [~,ia]=setdiff(A,B); result=NS(ia)...

How to make difference between two cell array?

fun=@(c) num2str(c,'%.20d '); A=cellfun(fun,NS,'uni',0); B=cellfun(fun,setL,'uni',0); [~,ia]=setdiff(A,B); result=NS(ia)...

4 days ago | 0

Answered

Calculate only diagonal elements of multidimensional array product

Since M is small, a for-loop would probably also be fine, [j,k]=sub2ind([M,M],1:M.^2); for i=1:M^2 B(j(i),k(i),:)=B...

Calculate only diagonal elements of multidimensional array product

Since M is small, a for-loop would probably also be fine, [j,k]=sub2ind([M,M],1:M.^2); for i=1:M^2 B(j(i),k(i),:)=B...

4 days ago | 0

Answered

Calculate only diagonal elements of multidimensional array product

Assuming your Matlab version is post-R2016b reuslt = sum(B.*A.',1) Otherwise, assuming your Matlab version is post-R2008 resu...

Calculate only diagonal elements of multidimensional array product

Assuming your Matlab version is post-R2016b reuslt = sum(B.*A.',1) Otherwise, assuming your Matlab version is post-R2008 resu...

4 days ago | 0

Answered

Least Square Minimization (Levenberg-Marquant method) of damped oscillation curves

You can use lsqcurvefit with the 'levenberg-marquardt' Algorithm setting https://www.mathworks.com/help/optim/ug/lsqcurvefit.ht...

Least Square Minimization (Levenberg-Marquant method) of damped oscillation curves

You can use lsqcurvefit with the 'levenberg-marquardt' Algorithm setting https://www.mathworks.com/help/optim/ug/lsqcurvefit.ht...

4 days ago | 0

| accepted

Answered

Phantom Variable within Object Method Calls

You must decide whether you want your classes to be handle classes or value classes. https://www.mathworks.com/help/matlab/matl...

Phantom Variable within Object Method Calls

You must decide whether you want your classes to be handle classes or value classes. https://www.mathworks.com/help/matlab/matl...

5 days ago | 1

Answered

Solve non-linear equation.

You can tell fzero to bound the search to a desired sub-interval. >> fzero(Equation_fun,[0,pi/2]) ans = 0.4012 >>...

Solve non-linear equation.

You can tell fzero to bound the search to a desired sub-interval. >> fzero(Equation_fun,[0,pi/2]) ans = 0.4012 >>...

5 days ago | 1

| accepted

Answered

Passing built fun tion to fminunc

[xf, ff] = fminunc( @(x) fun( x(1),x(2),(3),x(4) ),x0);

Passing built fun tion to fminunc

[xf, ff] = fminunc( @(x) fun( x(1),x(2),(3),x(4) ),x0);

5 days ago | 0

Answered

Keep getting error message "Dimensions of arrays being concatenated are not consistent." but not there if I changed the parameters

These lines will only work if V2 is always a scalar. V2 = double(solve(Ppeng(T1(n),V) == PC,V,'Real',true)); V1 = [V1,V2];

Keep getting error message "Dimensions of arrays being concatenated are not consistent." but not there if I changed the parameters

These lines will only work if V2 is always a scalar. V2 = double(solve(Ppeng(T1(n),V) == PC,V,'Real',true)); V1 = [V1,V2];

8 days ago | 0

Answered

Calculating median along specific dimension of 3D array

M=nan(90,1,1633); for i=1:90 M(i,:,:)=median(S(i,:,:),2); end

Calculating median along specific dimension of 3D array

M=nan(90,1,1633); for i=1:90 M(i,:,:)=median(S(i,:,:),2); end

8 days ago | 0

| accepted

Answered

How to join matching rows of cells in a particular column order

Not sure why you're working with cells, rather than tables, but it's easy enough to switch back and forth. A=cell2table(a); ...

How to join matching rows of cells in a particular column order

Not sure why you're working with cells, rather than tables, but it's easy enough to switch back and forth. A=cell2table(a); ...

15 days ago | 0

| accepted

Answered

fsolve and "Equation solved, fsolve stalled"

It means stopping criteria for the iterations were met. Fsolve cannot find a reason to continue.

fsolve and "Equation solved, fsolve stalled"

It means stopping criteria for the iterations were met. Fsolve cannot find a reason to continue.

15 days ago | 0

Answered

Orthogonal vectors, how to code?

Any two such vectors will have this parametric form, w= [0 cos(theta) sin(theta)] v=c*[0 -sin(theta) cos(theta)] where c=+1 ...

Orthogonal vectors, how to code?

Any two such vectors will have this parametric form, w= [0 cos(theta) sin(theta)] v=c*[0 -sin(theta) cos(theta)] where c=+1 ...

15 days ago | 0

Answered

comparing 3x3 block with center pixel

Here, X is the input matrix. result=0; result=result+1*rot90(fkernel(rot90(X,+1)),-1); result=result+2*rot90(fkernel(rot90(X,...

comparing 3x3 block with center pixel

Here, X is the input matrix. result=0; result=result+1*rot90(fkernel(rot90(X,+1)),-1); result=result+2*rot90(fkernel(rot90(X,...

15 days ago | 2

| accepted

Answered

Can someone propose some code that will "connect the dots" using circular arcs?

I have attached a version of TripletGraph.m which implements methods of joining the points with ideal circular arcs, as well as ...

Can someone propose some code that will "connect the dots" using circular arcs?

I have attached a version of TripletGraph.m which implements methods of joining the points with ideal circular arcs, as well as ...

17 days ago | 0