5,678 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

How do I display the terms of a binomial expansion (x+y)^n ?

One way, n=4; e=0:n; C=arrayfun(@(i)nchoosek(n,i),e); sprintf('%d*x^%d*y^%d ',[C;e;n-e]) '1*x^0*y^4 4*x^1*y^3 6*x^2*...

How do I display the terms of a binomial expansion (x+y)^n ?

One way, n=4; e=0:n; C=arrayfun(@(i)nchoosek(n,i),e); sprintf('%d*x^%d*y^%d ',[C;e;n-e]) '1*x^0*y^4 4*x^1*y^3 6*x^2*...

1 hour ago | 0

| accepted

Answered

Nonlinear data fitting using lsqnonlin for multiple variables

There's nothing special involved, a=___ b=___ y=___ x0=___ xlsq =lsqnonlin(@(x) modelfun(x,a,b,y), x0) function F=mode...

Nonlinear data fitting using lsqnonlin for multiple variables

There's nothing special involved, a=___ b=___ y=___ x0=___ xlsq =lsqnonlin(@(x) modelfun(x,a,b,y), x0) function F=mode...

2 hours ago | 0

Answered

Error "Too many output arguments" from fmincon

Do you mean I choose 'on' for the option "GradObj'' and 'GradConstr' and need to switch them to 'off'? Either switch them off o...

Error "Too many output arguments" from fmincon

Do you mean I choose 'on' for the option "GradObj'' and 'GradConstr' and need to switch them to 'off'? Either switch them off o...

16 hours ago | 0

| accepted

Answered

can any body find the mistake here? I am rotating the coordinates of the arc and then bringing it to its original position. but it is not coming back to its original position ????!!!!

Some observations, You never use a11,b11 anywhere. After rotating back, you perform a translation by x_origin, y_origin. In ot...

can any body find the mistake here? I am rotating the coordinates of the arc and then bringing it to its original position. but it is not coming back to its original position ????!!!!

Some observations, You never use a11,b11 anywhere. After rotating back, you perform a translation by x_origin, y_origin. In ot...

16 hours ago | 0

| accepted

Answered

Passing object instances.

Yes, you can. You can pass any variable to a function.

Passing object instances.

Yes, you can. You can pass any variable to a function.

18 hours ago | 0

Answered

Help with lsqnonline VLE (vapor liquid equilibrium) data.

x = lsqnonlin(@(x) optim(x(1:6),x(13),x(14),R,T,B11,VV,x(7:12),vL,n1,n2,Pe),x0);

Help with lsqnonline VLE (vapor liquid equilibrium) data.

x = lsqnonlin(@(x) optim(x(1:6),x(13),x(14),R,T,B11,VV,x(7:12),vL,n1,n2,Pe),x0);

22 hours ago | 0

Answered

Valid indices are restricted in parfor loops

You need to get familiar with Sliced Variables and their restrictions. Basically, if you have an expression like state(expr,k) i...

Valid indices are restricted in parfor loops

You need to get familiar with Sliced Variables and their restrictions. Basically, if you have an expression like state(expr,k) i...

22 hours ago | 2

| accepted

Answered

Find all combinaisons of sum of two vector that corresponds to the value of a third vector

tolerance=1e-6; [A,B,C]=deal(A(:),B(:),C(:)); %Make everything a column vector [Ar,Br,Cr]=deal(A,B.' , reshape(C,1,1,[]) )...

Find all combinaisons of sum of two vector that corresponds to the value of a third vector

tolerance=1e-6; [A,B,C]=deal(A(:),B(:),C(:)); %Make everything a column vector [Ar,Br,Cr]=deal(A,B.' , reshape(C,1,1,[]) )...

1 day ago | 0

| accepted

Answered

Concatenate Tables with/without "Join"

>> C = outerjoin(A,B,'Keys','Character','MergeKeys',true) C = 6×3 table Character Time1 Time2 ________...

Concatenate Tables with/without "Join"

>> C = outerjoin(A,B,'Keys','Character','MergeKeys',true) C = 6×3 table Character Time1 Time2 ________...

2 days ago | 0

| accepted

Answered

Quadprog 'interior-point-convex' failure

Simply l2-normalizing the rows of A also seems to help, load('testData-Matt.mat'); opts = optimoptions(@quadprog,'Algorithm'...

Quadprog 'interior-point-convex' failure

Simply l2-normalizing the rows of A also seems to help, load('testData-Matt.mat'); opts = optimoptions(@quadprog,'Algorithm'...

3 days ago | 1

| accepted

Answered

Quadprog 'interior-point-convex' failure

I don't have a pre-R2016a Matlab release readily at hand, and so I cannot compare performance. However, if the problem is simply...

Quadprog 'interior-point-convex' failure

I don't have a pre-R2016a Matlab release readily at hand, and so I cannot compare performance. However, if the problem is simply...

3 days ago | 0

Answered

how can i store the solution (3D mtarix) and its value for a population of N

So the question is how to store a set of 3D matrices? Why not use a 4D matrix Configs(:,:,:,1)=X1 Configs(:,:,:,2)=X2 ... C...

how can i store the solution (3D mtarix) and its value for a population of N

So the question is how to store a set of 3D matrices? Why not use a 4D matrix Configs(:,:,:,1)=X1 Configs(:,:,:,2)=X2 ... C...

3 days ago | 0

Answered

creating a curve from XYZ points (centreline) and then split curve into new points

Use a curve fitting function, like lsqcurvefit().

creating a curve from XYZ points (centreline) and then split curve into new points

Use a curve fitting function, like lsqcurvefit().

3 days ago | 0

Answered

Every point on 2D surface is being transformed by unknown function. How to interpolate coordinates of any point on 2D surface knowing few of them.

If you have a model of the transformation the best approach would be to do a surface fit.

Every point on 2D surface is being transformed by unknown function. How to interpolate coordinates of any point on 2D surface knowing few of them.

If you have a model of the transformation the best approach would be to do a surface fit.

4 days ago | 0

Answered

What does this "fsolve" message tell me?

Does a function evaulation error of (5.95853e-15 ) is not enough for the solution to be correct? Only you can know the answer ...

What does this "fsolve" message tell me?

Does a function evaulation error of (5.95853e-15 ) is not enough for the solution to be correct? Only you can know the answer ...

5 days ago | 2

| accepted

Answered

Vector Comparison According to Entities

[~,~,n]=unique(sort(A,1).','rows'); n=n(:).';

Vector Comparison According to Entities

[~,~,n]=unique(sort(A,1).','rows'); n=n(:).';

5 days ago | 1

| accepted

Answered

different matrix size after 3D interpolation

You could just use imresize3, new_SPECT = imresize3(SPECT, [512,512,263])

different matrix size after 3D interpolation

You could just use imresize3, new_SPECT = imresize3(SPECT, [512,512,263])

5 days ago | 0

Answered

Single-File Object-Oriented Script?

You could just create a static class method that runs what you would normally run in the workspace of the script, classdef some...

Single-File Object-Oriented Script?

You could just create a static class method that runs what you would normally run in the workspace of the script, classdef some...

5 days ago | 0

| accepted

Answered

Is there the more elegant way to do this?

You don't need the switch block. You can just do, items = get(hObject,'String'); index_selected = get(hObject,'Value'); cm ...

Is there the more elegant way to do this?

You don't need the switch block. You can just do, items = get(hObject,'String'); index_selected = get(hObject,'Value'); cm ...

5 days ago | 0

| accepted

Answered

How to find the transformation matrix for a plat knowing the old and new coordinates of 3 points on it ?

You could use this FEX file https://www.mathworks.com/matlabcentral/fileexchange/26186-absolute-orientation-horn-s-method

How to find the transformation matrix for a plat knowing the old and new coordinates of 3 points on it ?

You could use this FEX file https://www.mathworks.com/matlabcentral/fileexchange/26186-absolute-orientation-horn-s-method

5 days ago | 1

Answered

Can you create an array of Constraints in an Optimisation MILP problem?

The error message you are getting occurs when you do things like this, x=optimvar('Xname',252,1); y=optimvar('Xname',252,1); ...

Can you create an array of Constraints in an Optimisation MILP problem?

The error message you are getting occurs when you do things like this, x=optimvar('Xname',252,1); y=optimvar('Xname',252,1); ...

6 days ago | 0

Answered

Can you create an array of Constraints in an Optimisation MILP problem?

You can just write I=1:252; MymodelRP.Constraints.NewEnergyAllocation = ( Eih(I,1)+Eil(I,1)<=Cinew(I,1) );

Can you create an array of Constraints in an Optimisation MILP problem?

You can just write I=1:252; MymodelRP.Constraints.NewEnergyAllocation = ( Eih(I,1)+Eil(I,1)<=Cinew(I,1) );

6 days ago | 0

Answered

Converged to an infeasible point. fmincon stopped because the size of the current step is less than the default value of the step size tolerance but constraints are not satisfied to within the default value of the constraint tolerance.

There are no feasible solutions to your problem because it is impossible to satisfy the first equality constraint, zeros(1,leng...

Converged to an infeasible point. fmincon stopped because the size of the current step is less than the default value of the step size tolerance but constraints are not satisfied to within the default value of the constraint tolerance.

There are no feasible solutions to your problem because it is impossible to satisfy the first equality constraint, zeros(1,leng...

6 days ago | 0

Answered

Find n closest nonzero pixels for every nonzero pixel in an image

Using this information, I need to find the 10 closest nonzero pixels (indexed with their correponding distances to the central p...

Find n closest nonzero pixels for every nonzero pixel in an image

Using this information, I need to find the 10 closest nonzero pixels (indexed with their correponding distances to the central p...

7 days ago | 0

Answered

Interpolate y-values of two data sets on the same axes

ht1=sortrows([height1(:),temperature1(:)]); %pre-sort ht2=sortrows([height2(:),temperature2(:)]); Height=ht1(:,1); Temperat...

Interpolate y-values of two data sets on the same axes

ht1=sortrows([height1(:),temperature1(:)]); %pre-sort ht2=sortrows([height2(:),temperature2(:)]); Height=ht1(:,1); Temperat...

7 days ago | 1

| accepted

Answered

Creating a vector from two points using 3 coordinates

I think this would complete your code. Times=1:10:length(Data.Time); J=numel(Times); F=nan(J,3); for j = 1:J ...

Creating a vector from two points using 3 coordinates

I think this would complete your code. Times=1:10:length(Data.Time); J=numel(Times); F=nan(J,3); for j = 1:J ...

7 days ago | 0

| accepted

Answered

Illegal use of reserved keyword "switch"

Your switch block is not enclosed in a method...end block.

Illegal use of reserved keyword "switch"

Your switch block is not enclosed in a method...end block.

8 days ago | 0

Answered

Error using when cell2mat (with string characters)

Try char(Matrix) or string(Matrix)

Error using when cell2mat (with string characters)

Try char(Matrix) or string(Matrix)

8 days ago | 0

| accepted

Answered

Distance of a line by camera points

Well, I have no familiarity with the 3rd party Github library that you're using. However, it is a stereo camera class. So, it sh...

Distance of a line by camera points

Well, I have no familiarity with the 3rd party Github library that you're using. However, it is a stereo camera class. So, it sh...

8 days ago | 0