Community Profile

photo

Matt J


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

Contact

Matt J's Badges

  • Master
  • Revival Level 4
  • 36 Month Streak
  • Thankful Level 4
  • Knowledgeable Level 4
  • First Answer

View details...

Contributions in
View by

Answered
object detection in a binary image
>> bwimage=imbinarize(rgb2gray(imread('bwimage.jpg'))); >> locations=regionprops('table',~bwimage,'Centroid') locations = ...

2 days ago | 0

| accepted

Answered
Main diagonal operations problem
x=eye(4); x(1:5:end)=0.7*rand(4,1)+0.3

3 days ago | 1

Answered
Unique rows of 2 cells with 2 columns each.
I tried the following 2 codes: unique(vertcat(IdxMembers,IdxMembers2),'rows')... I get the unique values in dim (nr. of unique v...

3 days ago | 0

Answered
how to sort variable of an array?
sort(M,'descend')

3 days ago | 0

Answered
confront values in 2 matrix
min(A(1,:), B(1,:))

3 days ago | 2

Answered
Mean matrix of different size matrices in one cell array
cellfun( @(a)mean(a(:)) , A)

3 days ago | 0

Answered
upper and lower curves
You can use the quantile command https://www.mathworks.com/help/stats/quantile.html to determine the upper and lower quartiles...

3 days ago | 0

Answered
Adjust regionprops orientation in order to get 360 degree value.
theta = 90-Orientation assuming theta increases clockwise.

3 days ago | 0

Answered
using lsqcurvefit with normalized error
This way I get a good fit but then I cannot plot the 95% confidence interval. fmincon doesn't return the Jacobian, but it does ...

4 days ago | 1

| accepted

Answered
fmincon is nonlinear constraints satisfied, then not satisfied when I include objective function
The algorithms of fmincon try only to satisfy the nonlinear and A,b,Aeq,beq constraints at convergence. They do not pledge to sa...

4 days ago | 0

Answered
Question about for loop problem
I don't see any mistakes (that's why posting your error messages and output is always a good thing), however, the whole thing ca...

4 days ago | 0

Answered
How to find the indices that a point lays between?
Do you suggest another way? In case X is not increasing. If X,Y are non-monotonic, I would do [~,points] = pdist2([X(:),Y(:)],...

4 days ago | 1

Answered
How to find the indices that a point lays between?
find is inefficient. You should instead do, point1=discretize(xA,X); point2=point1+1;

5 days ago | 0

Answered
Split array into multiple columns based on another array
result = splitapply(@(x) {x}, DHB_combine,index_combine);

5 days ago | 0

Answered
how to plot a fitness or objective function with optimum values
Sounds like you want this? options = optimoptions('ga','PlotFcn',{'gaplotbestf','gaplotbestindiv'}); [x,fval] = ga(Objective...

5 days ago | 0

Answered
Multi-objective optimisation using results from external simulation
MATLAB optimization solvers require that you provide a function which take a guess of your unknowns as input and return the quan...

5 days ago | 1

Answered
Subset multidimensional array using a vector
idx=repmat({':'},1,ndims(A)); idx(1:numel(v))=num2cell(v); result=A(idx{:});

5 days ago | 1

Answered
Sorting and averaging matrices
[~,idx]=sort( reshape(A,8,[]) ,1); [m,n]=size(idx); C=reshape(B,m,n,[]); [m,n,p]=size(C); idx=i...

5 days ago | 2

| accepted

Answered
fmincon command to find minimum value of Rosenbrock's function in Polygonal domain
You have miscalculated your A and b. You can use vert2lcon to obtain them automatically, https://www.mathworks.com/matlabcentra...

6 days ago | 0

| accepted

Answered
Action shot function with multiple images
Yes, here is an approach that uses no loops, Image4D=double(cat(4,ImageCell{:})); MedianImage = median(Image4D,4); [~,idx...

6 days ago | 3

| accepted

Answered
Undefined function for input arguments of type 'double': how do I make them vectors and not doubles?
Here is the non-symbolic approach mentioned by Adam. function[val,g,H]=givenfGNM(x) %givenf() modified to output the Hessian a...

7 days ago | 1

Answered
Removing object from image using median filter
I'll call your 1xn cell array of images ImageCell. Then I think you want, Image4D=cat(4,ImageCell{:}); R=median( Image4D(:,:...

7 days ago | 2

| accepted

Answered
Avoiding local minimum with fmincon
So my question is: Is there any way to avoid local minimum using fmincon or fminunc? There is no systematic, problem-independen...

7 days ago | 2

Answered
Could anyone help me how to solve the issue.
[m,n]=size(a); differences=reshape(a,m,1,n) - reshape(a,1,m,n);

9 days ago | 1

| accepted

Answered
which way to call function is better?
I have more than hundred of input parameters in myfunc and I am using the following way to call the function after grouping the ...

9 days ago | 0

Answered
fmincon gradient of nonlinear inequality constraints must have size???
What is mysterious about the error message? It has told you that your gradc output has to be 4x12 and in your NLC2 you clearly o...

9 days ago | 0

Answered
What is the best way to store groups of 3 nearest non-zero pixels?
I would like to identify and store each set of 3 closest points (as seen in the attached image) in a separate variable. No, you...

9 days ago | 0

| accepted

Answered
matrix multiplication for "3-D" matrices
result=nan(2,2,100); result(1,1,:)=a11.*b11 + a12.*b21; result(1,2,:)=a11.*b12 + a12.*b22; result(2,1,:)=a21.*b11 + a22.*b2...

9 days ago | 0

| accepted

Answered
More than 580 billion possibilities
Sure, for example, count=0; for i=1:580*1e9 possibility=rand; if possibility>0.5 count=count+1...

9 days ago | 0

| accepted

Answered
GPU optimization of looped vector operations
This modification uses mat2tiles from the File Exchange, to help divide the computation into bigger, vectorized chunks https://...

9 days ago | 1

| accepted

Load more