Optimize model parameters given minimum sum of error square
It does not make sense that there are randomization operations like normrnd in your objective function. How can a function be "m...

9 days ago | 0

Question

Save and load alternative sets of preferences
I know how to set Preferences in Matlab through GUI buttons, however, suppose I have different sets of preferences that I wou...

10 days ago | 1 answer | 0

### 1

fsolve with one variabel
I don't understand why you would be using Symbolic Math Toolbox variables, syms x unless you were planning to use solve, Tinc...

12 days ago | 1

| accepted

curve fitting with dependencies between the coefficients
Re-express your model function as, sin(d1)^2*(1-exp(-a1*(t^n1))) + cos(d1)^2*sin(d2)^2*(1-exp(-a2*(t^n2))) +... ...

12 days ago | 0

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...

12 days ago | 0

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...

12 days ago | 0

| accepted

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

12 days ago | 0

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, ...

12 days ago | 0

| accepted

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...

12 days ago | 1

| accepted

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...

12 days ago | 0

| accepted

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 ...

13 days ago | 0

| accepted

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...

14 days ago | 0

Transform set of points into 2xN matrix
set1.'

14 days ago | 0

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

14 days ago | 0

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 ...

14 days 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....

15 days ago | 2 answers | 0

### 2

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 ...

15 days ago | 1 answer | 1

### 1

Presumably because b(end) is the perimeter, i.e., it is a polyshape containing almost no internal area.

16 days ago | 0

| accepted

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+...

16 days ago | 0

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

16 days ago | 0

| accepted

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 ...

16 days ago | 0

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

16 days ago | 2

| accepted

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

16 days ago | 0

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...

17 days ago | 1

| accepted

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(...

17 days ago | 0

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

17 days ago | 0

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

17 days ago | 1

| accepted

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...

18 days ago | 0