Answered
Global optimization - data type error
mu_dis = matlabFunction( sym_mu_c.^2 + sym_mu_m.^2 + sym_mu_v.^2 + sym_mu_o.^2 ); obj=@(x) mu_dis( x(1), x(2), x(3), x(4) )...

6 years ago | 0

| accepted

Answered
Efficient multiplication between arrays without for loops
[v1,v2,v3]=size(Vel); [e1,e2,e3]=size(Eigen); Eig=reshape(Eigen,[e1,e2,1,e3]); Q=Vel.*conj(Eig).*((mass)^0.5); Q_dot=r...

6 years ago | 0

| accepted

Answered
Maximization with an objective variable in the function
You can use fmincon, fmincon(@(x) -x(3), [Y0,L0,z0], [],[],[],[],lb,ub, @(x) nonlcon(x,P, W, iota , nu)); function [c,ceq...

6 years ago | 1

| accepted

Answered
Summing up values in a matrix
sum(l,[1,2])

6 years ago | 0

Answered
only one answer for for loop
This should really be done without a for-loop, z = repmat(ult(:),1,50); But if you insist on using a for-loop, you must tell t...

6 years ago | 0

| accepted

Answered
How can I replace integer values in a array?
B=(sign(A)+1)/2

6 years ago | 0

Answered
FSOLVE requires all values returned by functions to be of data type double.
I don't see any need for syms. a=linspace(0.5,1.5,100); nu=0.5; gamm=2e6; k=0; I=eye(3,3); w0=[0.6683,0.6683]; ...

6 years ago | 0

| accepted

Answered
Output arguments in App Designer
You could also use putvar, https://www.mathworks.com/matlabcentral/fileexchange/27106-putvar-uigetvar

6 years ago | 0

Answered
critical points on matlab?
r = roots(polyder(coefs)); criticalPts= = r(~imag(r))

6 years ago | 0

| accepted

Answered
How to find all or most of the multiple (at least locally optimal) solutions of a problem, as opposed to a single best solution using GA.? Multi-modal optimization.
You can use MultiStart https://www.mathworks.com/help/gads/example-finding-global-or-multiple-local-minima.html#bsds4eg

6 years ago | 0

| accepted

Answered
Binary multiplication in MATLAB.
A(:)*B

6 years ago | 0

| accepted

Answered
Output arguments in App Designer
Yes, you can use an app object to return arguments like any other class method, [out1,out2]=app.func(in1,in2)

6 years ago | 0

Answered
Question about parfor nested loop
So maybe it is the bug of the old versions. Yes, it appears to be version-related. I get the same thing in R2018a. Regardless, ...

6 years ago | 1

| accepted

Answered
intersection of a line y=ax+b with a matrix containing x and y
x_intersection = fzero(@(x) a*x+b-interp1(vec_x,vec_y,x) , vec_x([1,end]) )

6 years ago | 1

| accepted

Answered
conv from conv function and ifft
Most likely a zero-padding problem. https://www.mathworks.com/help/signal/ug/linear-and-circular-convolution.html

6 years ago | 0

Answered
How to calculate the distance between the edge of a square and a point in a local coordinate system
However, because i might have many points in the space of problem, i don't like to rotate points, and it's better to rotate the ...

6 years ago | 0

Answered
How to extract the points which are on a plane in 3D space
Say the plane point is x0,the normal vector is v, and the point cloud is an Nx3 matrix X, then v=v(:)/norm(v); %ensure unit col...

6 years ago | 0

Answered
fitting error calculation upto one standard deviation
There aren't any knobs you can turn in lsqcurvefit that will set the error of the final fit. The fitting error depends on the qu...

6 years ago | 0

Answered
Fast Fourier Transform in MATLAB
If you are getting different output from the same code, it can only mean that the input has changed.

6 years ago | 0

Answered
Decreasing the number of variables in optimization process (SQP - fmincon)
You can use the MaxIterations option to tell the solver to run no more than 20 iterations. Then, you can reformulate the optimiz...

6 years ago | 0

| accepted

Answered
How can I use the conv function to calculate convolution of two functions with different ranges?
I've thought about adding zero paddings to my x and h vectors but I'm not sure if that would work well with negative ranges. co...

6 years ago | 0

Answered
How to skip an optimization iteration if the constraint is violated ?
And I have a constraint , which, if it is not complied with, prevents the proper functioning of the function objective. In you...

6 years ago | 0

| accepted

Answered
Given One Partition of a Matrix, What is the Best Way to Find a Second Partition that Ensures the Matrix is Nonsingular?
V must be of the form A*C+B*null(C).' where B is a non-singular matrix. I don't think the rconds in your example are bad at al...

6 years ago | 1

Answered
fsolve is not returning the right solutions
The solutions you've cited definitely do not solve the equations you've provided, F=eqns([-1,0,1]) F=eqns([1,0,1]) func...

6 years ago | 0

Answered
How to alter the dimensions of a cell array?
Signals_v=num2cell(cell2mat(Signals_v),2);

6 years ago | 0

| accepted

Answered
GPU backslash performance much slower than CPU
This thread looks relevant. It appears that sparse mldivide on the GPU is not expected to be faster. https://www.mathworks.com/...

6 years ago | 0

Answered
Size of each cell
G1=findgroups(ARRAY(:,1)); G2=findgroups(ARRAY(:,2)); H1=histcounts(G1,1:max(G1)+1); H2=histcounts(G2,1:max(G2)+1); if a...

6 years ago | 0

Answered
Automatic bounding box creation in an image for image segmentation.
See Create Rectangle Programmatically.

6 years ago | 0

Answered
How can I do a star?
If you know the vertices of the star, you can just use the line() or plot() command.

6 years ago | 0

Answered
genetic algorithm problems.
It appears that you haven't provided sufficient constraints to keep the solution bounded away from areas where the objective fun...

6 years ago | 0

Load more