Answered
What happens if I use parfor and the fmincon/fminunc option "UseParallel" together?
I don't know the answer to that directly, but it is easy to show by example that turning off 'UseParallel' can be beneficial: o...

6 years ago | 0

Answered
fmincon Constraint Query Optimization
Generally, all constraints must operate on the total set of unknows x1,..x10. However, given A1,A2, b1,b2 it is simple enough to...

6 years ago | 0

| accepted

Answered
show det(A) = det(A') ?
But it's not true! A=rand(200); isequal(det(A),det(A.'))

6 years ago | 0

Answered
Optimization problem on Constraint declaration
We can't tell from your code what the relation is supposed to be between a, wd and x. This might be what you were trying to do, ...

6 years ago | 0

| accepted

Answered
How to use for loop to set properties' attributes in MATLAB class?
You cannot put a for loop or other complex code inside a properties block. If you wish, you can set a default value for a proper...

6 years ago | 1

| accepted

Answered
Using the given code, how can I optimize a matrix to minimize a cost function?
Well, the way you would approach it is using fmincon as below. Using your initial guess of zeros(N,M), fmincon is unable to find...

6 years ago | 0

| accepted

Answered
How to input dependent parameters in matlab function?
These two, out = myfun(A,B,optionC,dependent_C1) out = myfun(A,B,optionC,dependent_C2) are not possible simultaneously. If ...

6 years ago | 0

| accepted

Answered
fmincon - Converged to an infeasible point.
The max() operations in your constraints disqualify fmincon as a valid tool for this problem - the constraint functions are assu...

6 years ago | 0

Answered
Transform set of points into 2xN matrix
set1.'

6 years ago | 0

Answered
checking input an integer greater than 0?
validateattributes(yourInput,"numeric",{"integer","nonnegative"})

6 years ago | 0

Answered
Why do the ylabel renderings look different when Property Inspector says they are the same?
I figured it out. The syntax for the second plot needed to be, ylabel('Local Deviation (\%)','Interpreter','latex') ; %percent ...

6 years ago | 0

| accepted

Question


Why do the ylabel renderings look different when Property Inspector says they are the same?
The image below is a screenshot of two different y-axis labels that I have in two different figure windows, generated in R2020a....

6 years ago | 2 answers | 0

2

answers

Question


How to load a .mat file from a URL
I find that I cannot load a .mat file from a URL. For example, when I try to call load() with the full URL of the attached .mat ...

6 years ago | 1 answer | 2

1

answer

Answered
Problems about "rotate" function
Presumably because b(end) is the perimeter, i.e., it is a polyshape containing almost no internal area.

6 years ago | 0

| accepted

Answered
Why am I getting 'NaN' values in my vector?
I don't understand the instructions, but maybe this is what it means: x(i+18+1) = mod( x(i+7+1) + x(i+1), 2); y(i+18+...

6 years ago | 0

Answered
fmincon nonlinear inequality constraints
function [c, ceq] = nlcon(p) c = p(4)-exp(p(1)-p(2).*p(3).^log(1./2.7)) -35 ; ceq =[ ]; end

6 years ago | 0

| accepted

Answered
Matrix Operations Horizontal and Vertical Shifts
The spy() function does not care if its input is square, but it doesn't have any relevance to shifting images. I don't know why ...

6 years ago | 0

Answered
multiplying matrix by another matrix element and using it in a command
clear e for i=numel(T):-1:1 e(:,:,i)=expm(Q*T(i)); end

6 years ago | 2

| accepted

Answered
Distance Matrix Without Loop
x = [3, 5, 10]; y = [3, 5, 10]; A = abs(x(:)-y(:).')

6 years ago | 0

Answered
Hello every one, I have a question related to approximation of functions based on norms
You would not use fmincon. For L1, you could use minl1lin https://www.mathworks.com/matlabcentral/fileexchange/52795-constraine...

6 years ago | 1

| accepted

Answered
Expand a coordinate array to be wider
I'm assuming A and B are the struct output from regionprops: Z=false(size(BW)); Aunion=Z; for i=1:numel(A) Aunion(A(...

6 years ago | 0

Answered
Multiplying each value of a vector with the corresponding value in another vector?
theta = (E.*A.*alpha.*temp.*[-1 ,1]).'

6 years ago | 0

Answered
Multiplication of matrix including function with vectors
G(s) = C.' * v * B

6 years ago | 1

| accepted

Answered
Decimal matrix to binary matrix correspond to each value of decimal matrix.
I just want to be sure you are aware, Matlab is capable of doing bitwise operations on matrices (using bitor, bitand, etc... ) e...

6 years ago | 0

Answered
How to minimize the L1 norm of residuals?
FMINSEARCH would be a good candidate, since you have only two unknowns fun=@(param) norm( f - y(end)./(1 + 10.^((param(1) - x)*...

6 years ago | 0

| accepted

Answered
How to use implicit model functions in Curve fitting toolbox
An analytical solution is possible here, [x,y]=deal(x(:),y(:)); A=[x.^2,y.^2,y]; s=std(A,1); [~,~,V]=svd(A./s,0); abc=V(:...

6 years ago | 2

Answered
how to know the location pixel
If you mean you want the centroids of the different regions, it would be easier to use regionprops stats=regionprops(BW16,'Cent...

6 years ago | 0

Answered
Addition of constraints in a loop
Easiest if you just write this as 5 constraints: c = optimvar('c', 'LowerBound',0,'UpperBound',1); prob1 = optimproble...

6 years ago | 0

Answered
Supplied objective function must return a scalar value
The objective function must return a scalar value, because fmincon is trying to minimize it. It needs to be able to make compari...

6 years ago | 0

| accepted

Load more