Community Profile

# Matt J

5,784 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.

#### Matt J's Badges

View details...

Contributions in
View by

Issue about "the same lower bound and upper bound" in 'fmincon'
No, it is not wrong. It probably means you have multiple solutions or that the differences are merely floating point noise. You ...

2 hours ago | 0

How to fit some curves to one curve in which only the maximum of curves are fitted?
Generate the maximum of all your curves and use alphashape() to smooth over concavities in its envelope.

1 day ago | 0

Using fmincon on a vector of anonymous functions
I would recommend that you implement E(A) through a non-anonymous function, as below. Note that I have changed your objective to...

3 days ago | 0

| accepted

find whole lines, not line segments, after hough transform
If you have the Computer Vision Toolbox, you can try RANSAC, as in this example https://www.mathworks.com/help/vision/ref/ransa...

3 days ago | 0

| accepted

estimate depth with two different focal lengths
Why should it matter that the focal lengths are different? There is nothing in the syntax of the triangulate command https://ww...

3 days ago | 0

| accepted

I would be grateful to receive some example of usage of builtin function 'regionprops'
Because I don't have R2019b, I had to run a somewhat modified version of the code S=load('BWCurve.mat','CBW'); BW=S.CBW; % Ge...

3 days ago | 0

| accepted

How to solve the problem about "Conversion to logical from optim.problemdef.OptimizationConstraint is not possible!"
Introduce variables r to represent bounds on Pbatt r=optimvar('absPbatt',simTime1,'LowerBound',0); prob.Constraints.r_upper=...

3 days ago | 0

| accepted

Fminsearchbnd vs. Pattern Search vs. Surrogate Optimzation to attempt to find the global optimal solution.
There is no way to predict the number of multi-starts you would need to make fminsearchbnd behave competitively with the other s...

3 days ago | 0

Is there a difference between declaring a class property "Dependent" versus "Dependent = true"?
Yes, they are equivalent. Also, you can do, properties(~Dependent) aProp end as an equivalent to, properties(Dependent=...

10 days ago | 1

| accepted

How to integrate an unbounded function?
You cantry use the symbolic toolbox, or you could just take the numerical integral over a sufficiently large finite interval. A ...

10 days ago | 0

Optimization solver: retrieval of Constraint matrices
Yes, use prob2struct, https://www.mathworks.com/help/optim/ug/optim.problemdef.optimizationproblem.prob2struct.html

10 days ago | 0

| accepted

Why output of rotation matrix in Camera Calibration is vector ? What do to convert to rotation matrix ?
A cameraParameters object also has a property that stores the rotations in matrix form https://www.mathworks.com/help/vision/re...

10 days ago | 0

Find constraints on polynomial coefficients optimization
It might be more natural here to use fseminf, x = fseminf(fun,[a1,a2,a3], 2, @(a,s) seminfcon(a,s,T,lb,ub)); function [c,...

11 days ago | 0

Find constraints on polynomial coefficients optimization
What's to figure out? You've already articulated that the (nonlinear) constraints on the extremum are, 0<=-a2/(2*a1)<=T The on...

11 days ago | 0

fmincon generating (very) noisy results - initial guesses probably to blame
If you're suspicious about the initial point, I would recommend MultiStart, or just try lots of different initial guesses yourse...

11 days ago | 0

Constraint of optimization problem
It's the wrong solver. You would need to use ga() for a problem like that.

11 days ago | 0

| accepted

How to normalise a FFT of a 3 variable function.
To normalize so as to obtain Discrete Fourier Series coefficients, divide by N=numel(input).

11 days ago | 0

How to normalise a FFT of a 3 variable function.
To normalize so that the continuous Fourier transform is approximated, multiply by the sampling intervals, dT1*dT2*dT3

11 days ago | 0

How to normalise a FFT of a 3 variable function.
To normalize so that Parseval's equation holds, divide by sqrt(numel(input)).

11 days ago | 0

Subtract according to the values in another column
[~,i]=unique([C1,C1(end+1)],'stable'); result = C2(i(2:end)-1)-C2(i(1:end-1))

11 days ago | 0

Can we use scatteredinterpolant in parallel
You can certainly divide queries into parallel batches, e.g., F=scatteredInterpolant(P,v); results=cell(size(batch)); parfo...

12 days ago | 0

Can parallel computing toolbox not parallellise over multiple CPUs?
12 is the upper limit if you are using a version of Matlab earlier than R2014a, see also https://www.mathworks.com/matlabcentra...

12 days ago | 0

Conditional Skip in for loop
Apply the suggestions in this thread to A=logical(x)+1.

13 days ago | 0

| accepted

How to plot Intensity profile along the vertical line of an image
y = [0 size(I,1)]; x = [size(I,2)/2 size(I,2)/2];

13 days ago | 0

| accepted

Find first three numbers in a matrix that satisfy the condition x>0.001
B=find(A(:,1)>0.001,3)

13 days ago | 0

| accepted

Why do I get no solution found in Fsolve despite the results match my nonlinear equations ?
You're asking for guesses? Because you are not plugging the solution into the same equations that were given to fsolve. fsolve t...

15 days ago | 1

| accepted

Export residuals from curve fitting
Instead of using cftool, use the fit() command, [fitobject,gof,output] = fit(x,y,'poly1','Weights', w); residuals=output.res...

15 days ago | 0

| accepted

Export residuals from curve fitting
For a simple 1 degree polynomial, why not just use polyfit? p=polyfit(x,y,1); residuals=polyval(p,x)-y;

15 days ago | 0