Answered
How to calculate the centroid of these bounding boxes which their 4 vertices are stored in cell array?
centroids = cellfun(@(z) mean(cell2mat(z(:))) ,c ,'UniformOutput' ,false)

4 years ago | 1

| accepted

Answered
Counting outcomes of names
Something like this, perhaps? investors=["Sam";"Joe";"Sam and Joe"] contains(investors,"Sam")

4 years ago | 0

| accepted

Answered
How to count the number of pixels in each section of an image set?
A = imread('toyobjects.png'); A = A<100 | A>150; % some binary image % get total number of pixels across all objects pixt...

4 years ago | 2

| accepted

Answered
Merge the output from regionprops 'BoundingBox' into the format required for groundTruth.
Let's say you have bounding box data from calling regionprops on some number of image frames. Then, your loop to organize the bo...

4 years ago | 0

| accepted

Answered
permutations of 4 numbers in 7 positions IF the sum of the numbers is 600
See the attached file. combos = diophantine(ones(1,7),600,[0,100,125,75,50]) all(sum(combos,2)==600)

4 years ago | 0

Answered
while loop not performing
A=[-0.2 0.1; 0.1 -2]; vm=[1; 1]; vm=vm/norm(vm); while (1) term=A*vm; nterm=norm(term); ea= nterm-ab...

4 years ago | 0

| accepted

Answered
Revolving a curve about the y-axis to generate a 3D surface
Why not just revole around whatever axis cylinder() acommodates and then use rotate? Or, interchange the data when you plot, e....

4 years ago | 0

Answered
Can I pass a variable to the outside of a for loop after each iteration?
Is there any way this is possible? Sure. For example, n=3; i=1; while i<200 disp("i="+i+" n="+n) ...

4 years ago | 0

Answered
I would like to pick the consecutive cells those satistfies my given condition
You might benefit from downloading, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive...

4 years ago | 0

| accepted

Answered
How can i write three different condition in a single loop
for i=1:N if i==1 elseif i<N else %i==N end end

4 years ago | 0

| accepted

Answered
I want to use GA algorithm, but it gives me this error "Not enough input arguments. "
x = ga(@flc_cost_fcn,17,[],[],[],[],LB,UB,[],options);

4 years ago | 0

| accepted

Answered
3D mesh - Limit Z axis height, but just for the function, not the entire 3D domain
One possibility. X=linspace(0,2,20); Y=linspace(-5,1,20); [X,Y]=meshgrid(X,Y); Z=((Y.^2)); Z(Z>=4)=nan; surf(X,Y,Z); ...

4 years ago | 1

| accepted

Answered
how to solve an optimization with a function in objective function
ga and surrogateopt are designed for problems of that form.

4 years ago | 1

Answered
Simple question about for loop
There is no way to know from the code you've shown. You've shown us the dimensions of A{i}, but not of b. In any case, you might...

4 years ago | 0

| accepted

Answered
why point correspondence to rotation matrix calculation is not my expected?
r needs to be pre-multiplied by P1, not post-multiplied. P1 = [1,0,0]; eular = [0,pi/2,pi/2]; r = eul2rotm(eular,'ZYX'); ...

4 years ago | 0

| accepted

Answered
Transforming 2D image coordinates to 3D world coordinates
If you have pixel coordinates of a 3D point imaged by two cameras, you can use the triangulate command to triangulate the 3D loc...

4 years ago | 0

Answered
Transforming 2D image coordinates to 3D world coordinates
The inversion is not unique, but if you don't care which of the infinite choices there are for the 3D point, one possibility is,...

4 years ago | 0

Answered
i want to translate this vector to a formal syntax that i can use always
b=repelem(t,n)

4 years ago | 0

| accepted

Answered
Removing pages with all nan values from a multidimensional array
discard=all( isnan(XYZ) ,[1,2]); XYZ(:,:,discard)=[];

4 years ago | 0

| accepted

Answered
use ga optimization but got error for ga process
Perhaps you meant to have, y=(4*x1.^2)-2.1*x1.^4+1/3*x1.^6+(x1*x2)-4*x1.^2+4*x2.^4; or y=(4*x1.^2)-2.1*x1.^4+1/3*x1.^6+(x1*x2...

4 years ago | 0

Answered
How to make Genetic Algortihm function to solve the whole population at once and get the results of whole populatıon at once?
You can do that with the UseVectorized option. https://www.mathworks.com/help/gads/genetic-algorithm-options.html#f17234

4 years ago | 1

| accepted

Answered
Accessing data within a structure
plot(angles.LKNeeAngles(:,3))

4 years ago | 1

Answered
wyh rotation matrix convert to eular angle is not same with original eular?
It is the same, because eul2rotm is not a 1-1 function. eular1 = [pi/2,pi,-pi/2]; % ZYX default order r = eul2rotm(eular1,'ZY...

4 years ago | 0

| accepted

Answered
quadprog constraints with minimum value
If you have the Global Optimization Toolbox, you could also try using ga() with additional binary variables b(i). Denoting your...

4 years ago | 0

Answered
quadprog constraints with minimum value
One possible alternative would be to use minL1lin, https://www.mathworks.com/matlabcentral/fileexchange/52795-constrained-minim...

4 years ago | 0

| accepted

Answered
quadprog constraints with minimum value
If the lower bounds of asset are set to 0.5%, then all assets in the optimization universe would need to have at least 0.5% weig...

4 years ago | 0

Answered
Minimization problem with integral constraint
Perhaps you could reparametrize the curve as, which automatically satisfies the constraint for any b and c....

4 years ago | 1

| accepted

Answered
Time consumption of string copied to string array
pos a scalar between 1 and the length of obj.dataList and value a string. That is definitely not the case. In the preceding lin...

4 years ago | 0

| accepted

Answered
Calculate waypoints for a moving plane with a radar
Isn't it just waypoints=[1,40,80,150,400] X_transmitter = 310; for i=1:numel(waypoints) Y_transmitter =...

4 years ago | 0

| accepted

Load more