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

7 jours ago | 0

| accepted

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

8 jours ago | 1

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...

8 jours ago | 0

| accepted

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

8 jours ago | 0

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

8 jours ago | 2

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

8 jours ago | 0

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...

8 jours ago | 0

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

8 jours ago | 0

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 ...

9 jours ago | 1

| accepted

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...

9 jours ago | 0

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...

9 jours ago | 0

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(:)],...

9 jours ago | 1

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

9 jours ago | 0

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

9 jours ago | 0

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...

10 jours ago | 0

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...

10 jours ago | 1

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

10 jours ago | 1

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...

10 jours ago | 2

| accepted

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...

10 jours ago | 0

| accepted

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...

11 jours ago | 3

| accepted

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...

12 jours ago | 1

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(:,:...

12 jours ago | 2

| accepted

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...

12 jours ago | 2

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

13 jours ago | 1

| accepted

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 ...

13 jours ago | 0

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...

13 jours ago | 0

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...

14 jours ago | 0

| accepted

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...

14 jours ago | 0

| accepted

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

14 jours ago | 0

| accepted