Answered
How to merge coordinates that are close together into one ?
Perhaps with clusterdata()?

5 years ago | 0

Answered
Execution of script quadprog as a function is not supported
Do not name your script quadprog.m

5 years ago | 0

Answered
How to obtain a Matrix?
Perhaps as follows? vector=[ 5; 10; 3] ; n=numel(vector); matrix=zeros(n); %pre-allocate s=vector; for i=1:n i...

5 years ago | 1

Answered
Is there a way to assign a variable-dimension calculation to an array of generic dimension?
This will work independently of the dimension of Xinput: function Output=Cfunction(Xinput) Output(2,:)=5*Xinput(:); ...

5 years ago | 0

| accepted

Answered
how I can delete value from an array?
m=4;node_tk=2; node=1:m, node(node_tk==node)=[]

5 years ago | 0

| accepted

Answered
Unconstrained optimization problem fminunc with modified least squares
The exit message looks fine. It's not an error.

5 years ago | 0

Answered
Can lsqnonlin regress morethan one parameter?
It is a strange usage of lsqnonlin to solve for only a single unknown parameter. For that, you would normally just use fminsearc...

5 years ago | 0

Answered
GA optimization terminated before the max generation and fitness limit
or there have some default terminating condition inside of the GA toobox? There are 11 different termination conditions used by...

5 years ago | 0

Answered
Optimization Formulation for "Complex" Constraints
I am not sure how to treat the inputs tau and f into fmincon() because the objective function is not explicitly a function of ta...

5 years ago | 0

| accepted

Answered
Four of 3D points: How to find 1 of them closest to a given point?
XYZ=[simulation.x(:), simulation.y(:),simulation.z(:)]; xyz=[measurementValues.x(:), measurementValues.y(:),measurementValues.z...

5 years ago | 0

Answered
Vector to lower-triangular matrix
b=rand(1,10) n=roots([1,1,-2*numel(b)]); n=n(n>0)+1; validateattributes(n,{'numeric'},{'positive', 'integer'}) %numel(b) mu...

5 years ago | 1

Answered
Find the average of all cells in a row.
Keeping things in cell array form when you have equal-sized cell contents is unnecessarily complicated (and slow). If you had th...

5 years ago | 0

Answered
Perform calulations on moving window of data
but the problem is that it centres the moving average windows i don't want that. The function you reference is not limited to c...

5 years ago | 0

Answered
locate (x,y) coordinates on an image
Assuming the transform type you're using supports it, you would use transformPointsInverse. https://www.mathworks.com/help/imag...

5 years ago | 0

Answered
how to generate random point that have fix distance between each point
Another idea is to generate a chequerboard, and then pick a random point inside all the black (or all the white) squares. [x,y]...

5 years ago | 0

| accepted

Answered
why does this integral fail?
I expect all terms in the function to be scalars If so then, use the ArrayValued option. fun=@(x,t,A,w,t1) (A*w/pi)*(1-exp(-(t...

5 years ago | 1

| accepted

Answered
Find positions of elements in rows of one matrix in rows of another matrix (efficiency question)
N=500; a = randi(N,N); b = randi(N,N); c1 = zeros(size(a)); [~,m] = size(a); tic; for i = 1:m c1(bsxfun(@eq, a, b...

5 years ago | 0

| accepted

Answered
Unable to data fitting with Lsqnonlin and estimate the coefficient. Need help fitting the data.
Since it's a fairly inexpensive 1D function , I think you should just be able to do a 1D grid search over a suitable interval t...

5 years ago | 0

| accepted

Answered
Curve fiting using fittype with a varying power
place = [0;0.2;0.5;0.8;1]; temp_2 = [2900;2100;1100;400;10]; x=1-place.^2+1e-6; [f, goodness] = fit(x,temp_2,'power1') ...

5 years ago | 0

| accepted

Answered
Find indices of missing values
Perhaps as follows? A = [158;175;193;211;229;247;265;283;301;319;337;355;373;390]; B = [158;194;211;228;244;264;301;319;338;35...

5 years ago | 2

| accepted

Answered
How do i find connected components in binary image
You can use bwconncomp() or regionprops().

5 years ago | 0

Answered
How can I stop my program if the user enters 0 for all variables?
while any([a,b,c,x]) ... end

5 years ago | 0

Answered
Replacing a group of values in a matrix
If you don't have the Image Processing Toolbox, you can also do, M=conv2(M,ones(8),'same');

5 years ago | 1

| accepted

Answered
how to put constraints on the derivative of a polynomial for a curve fitting problem
If you use a 5th order spline, the derivatives will automatically be continuous up to 4th order. In any case, you might be reinv...

5 years ago | 0

Answered
How to get rid of small difference (or error) when I multiply 0.1?
Use uniquetol(), e.g., ls=1:10; uniquetol(diff(ls*0.1),1e-5)

5 years ago | 1

| accepted

Answered
How to make a ''51x1 double'' to a ''x = [1,2,3,4]''
x=1:5;

5 years ago | 0

| accepted

Answered
could anyone help me how to convert double to cell in an array.
B=cell(size(A)); for i=1:numel(A) B{i}=splitapply(@(x){x}, 1:numel(A{i}) ,A{i}); end

5 years ago | 0

| accepted

Answered
Replacing a group of values in a matrix
M=imdilate(M,ones(8))

5 years ago | 1

Answered
How to fit a circle to 5 points conforming to a mesh
Like John, I don't think you've fully defined what it is that you're trying to calculate. One possibility though is to use circu...

5 years ago | 0

| accepted

Load more