Answered
need for the Optimisation toolbox
Yes.

4 years ago | 0

Answered
Length of a plotted line
h=plot(2:6); xlength = h.XData(end)-h.XData(1)

4 years ago | 0

| accepted

Answered
Merging the Cell Array Elements
C=string(reshape(yourCell,2,[])'); out=cellstr( C(:,1)+C(:,2) );

4 years ago | 0

| accepted

Answered
Convert 2d image to 3d
You cannot recover a 3D point from only a single 2D projection of that point. This is because every point [X,Y,Z] along the line...

4 years ago | 0

| accepted

Answered
Problem with optimization using fmincon
It looks like there are supposed to be some additional, more interesting constraints. Otherwise, if you have only bounds, the mi...

4 years ago | 1

| accepted

Answered
nonlinear problem with 300 varibales
Although increase iteration number and MaxFunctionEvaluations but it shows same message as follows My guess would be that you ...

4 years ago | 2

| accepted

Answered
Remove array elements if a certain condition is met with a for loop
Value( all(abs(JDF)<=2.5,2) )=[];

4 years ago | 0

Answered
How to perform image registration on non-rectangular image
If you have the Optimization Toolbox, you could use lsqcurvefit (don't be misled by the name) to minimize your own reigstration...

4 years ago | 0

Answered
How to do "not equal to" constraints in fmincon/Global search?
I need to test somehow if the solution i get from Global Search is unique. The run() command, with 5 output arguments, can ret...

4 years ago | 0

| accepted

Answered
Should we always search for the global minima in our optimization problem?
I am wondering should we always search for the global minima in our fitting (optimization) problem by using e.g. multistart or g...

4 years ago | 1

Answered
How to do "not equal to" constraints in fmincon/Global search?
You could impose a constraint like as a smooth approximation to . function [c,ceq,gradc,gradceq]=nonlcon(x,r) ceq=[]; g...

4 years ago | 0

Answered
Center to center distances between lines: Error in vertical distances
See here, https://www.mathworks.com/matlabcentral/answers/1718920-how-to-measure-and-show-the-center-to-center-distance-between...

4 years ago | 0

Answered
How to plot a function continuously by dragging a slider in AppDesigner
Use the ValueChangingFcn callback instead of the ValueChangedFcn callback. See also this example, https://www.mathworks.com/hel...

4 years ago | 1

| accepted

Answered
How to define double slits on x-axis
u=@(x) abs(x-0.05)<=0.05 | abs(x-10.15)<=0.05; tiledlayout(1,2); nexttile; fplot(u,[-0.1,0.2]); axis padded nexttile; fplot...

4 years ago | 1

| accepted

Answered
Randomly select a column
x=n(:,randperm(100,20))

4 years ago | 0

| accepted

Answered
Is there a built-in function to validate a class property that should be a cell array?
There is always iscell(): classdef ... methods function obj=set.A(obj,A) assert(iscell(A),'Value assigned to A ...

4 years ago | 0

Answered
How to rotate a plotted square with analog input?
Easiest is to use polyshape, h1=nsidedpoly(4,'SideLength',5,'Center',[2,3]+2.5); h2=rotate(h1,30, [2,3]+2.5); plot([h1,h2])...

4 years ago | 0

Answered
Obtain the transposed matrix from 2 vectors (MATLAB)
You can do a pseudo-inversion with, c=[1 0 0 0 0 1 1 0 1 0 0 0]; s=[0 1 0 1 1 1]; HT=c\s; c*HT-s however, you have far mo...

4 years ago | 0

Answered
If I let A, B, and C be 2x2 matrices, is it possible for me to assign a label to each matrix element in matrix C where C = A*B?
The attached class might be what you are looking for, if all you want to do are the operations C=A*B. To understand what it's do...

4 years ago | 2

Answered
If A and B are 2x2 matrices, how is the input (A*B)^2 interpreted by MATLAB as?
It is interpreted as, tmp=A*B; C=tmp*tmp;

4 years ago | 1

Answered
Ellipse with a, b and angle between semi major axis and x-axis variable
Very straightforward if you download this, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-for...

4 years ago | 0

Answered
Manipulating Cell arrays element
aa(ss==2)={[]};

4 years ago | 1

| accepted

Answered
Remove outliers in matlab 2018a
Perhaps as follows: A=repmat((1:5)',1,5); A(end-1)=100, tf=isoutlier(A(:,5)); A(tf,:)=[]

4 years ago | 0

| accepted

Answered
How can i calculate diameter of the red object ?
Assuming you don't care about camera perspective issues, why not with, regionprops(___,'EquivDiameter') Or, since you have alr...

4 years ago | 0

| accepted

Answered
If I let A, B, and C be 2x2 matrices, is it possible for me to assign a label to each matrix element in matrix C where C = A*B?
I'm talking about assigning a variable to each matrix element One way, A=rand(2); B=rand(2); C=A*B, tmp=num2cell(C); [c1...

4 years ago | 0

| accepted

Answered
Optimization with maximum number of "nonzero" x
Another approach is to reformulate problem in the form, min. norm(x,1) s.t. objective(x)<=C %and other constraints This does...

4 years ago | 0

Answered
Optimization with maximum number of "nonzero" x
To handle that with a continuous-domain optimizer like fmincon, you must run a separate fmincon optimization for every possible ...

4 years ago | 0

Answered
How to fill a gap between line segments in an image
load gap Irasterl=imclose(Irasterl,ones(3)); imshow(Irasterl,[])

4 years ago | 0

| accepted

Answered
Produce simple iradon geometry
data = [0,1,2,3,4,3,2,1,0]; theta=linspace(0,180,1000); theta(end)=[]; R1 = radon(data,theta); figure(2) N=numel(theta);...

4 years ago | 0

| accepted

Answered
because NaN or Inf function value encountered during search while using fzero
The problem occurs because func() has no axis crossing. aa=810930; bb=1216395; func = @(xt) 5e6-5e6*(exp(-aa*xt)-exp(-bb*xt))...

4 years ago | 0

| accepted

Load more