Answered
Running function on GPU for all combination of variables
Here's a loop-free method using ndgridVecs, https://www.mathworks.com/matlabcentral/fileexchange/74956-ndgridvecs but bear in ...

6 years ago | 0

Answered
construction of diagonal matrix of functions
This might be what you want. It assumes that f_1,2,3(x) work element-wise. function A=func(x) f1=f_1(x(1:end-1)); f2=f_2(...

6 years ago | 0

| accepted

Answered
construction of diagonal matrix of functions
function A=func(x,n) e=zeros(1,n-2); f1=f_1(x); f2=f_2(x); f3=f_3(x); A=toeplitz([f2,f1,e], [f2,f3,e]); ...

6 years ago | 0

Answered
Running function on GPU for all combination of variables
In this case, I'd use parfor to descrease the simulation duration, but the size of this variable is quite large so I'd prefer to...

6 years ago | 0

| accepted

Answered
Optimization of a unknown vector variable
H1=sum(h1); H2=sum(h2); H3=sum(h3); obj=@(a,b) H1.*a.^2 +H2.*b.^2+H3; x0=[1,1]; lb = []; ub = []; Aeq = []; beq =[];...

6 years ago | 0

| accepted

Answered
Is it possible to find out an unknown variable within constraint which is not present in the objective for a optimization problem?
Yes. It is not a problem if your objective only depends on a subset of variables. However, you must pass the full unknown vector...

6 years ago | 2

| accepted

Answered
FSOLVE GIVES SAME VALUE
clc;clearvars;close all; format short g;format compact; tfinal=30; pars.D=0.00005611; pars.x2f=20; pars.Y=0.4; pars.beta=0....

6 years ago | 1

Answered
Linprog stopped because no point satisfies the constraints.
linprog is telling you that no solution exists, because there is no x that satisfies your constraints. Your problem must have a ...

6 years ago | 0

Answered
How can I straighten edges of calibrated images ?
Try setting the 'OutputView' option to 'valid' https://www.mathworks.com/help/vision/ref/undistortfisheyeimage.html#d122e205695...

6 years ago | 1

| accepted

Answered
lsqnonlin seems stuck at the same residual value,norm step and first order optimality for a while now
For a 3-variable problem known to have non-differentiabilities, it would make sense to use fminsearch instead of lsqnonlin. Ther...

6 years ago | 0

Answered
Optimization function based on different domain of optimized variables
Solve the problem twice, once with the constraint x1<=k and once with x1>=k, imposing the appropriate objective function in each...

6 years ago | 0

| accepted

Answered
Change white pixels to invisible
Shouldn't you have alphachannel = 1-double(all(image == 255, 3));

6 years ago | 0

Answered
Converting strings to operators
I can't tell if you really intend S to be a string vector because that dpesn't agree with the example you posted. If I assume it...

6 years ago | 2

Answered
optimization problem of areas
Your objective function Area2 is written to be a function of z, but nothing in sum( ( x.*dt(m(1):c(1)) ) ) depnds on z. Perha...

6 years ago | 0

| accepted

Answered
Fmincon gives relative maximum constraint violation but still gives output due to conflicting constraints.
For example, [tmp,fval,exitflag] = fmincon(Total_Profit,Guess,A,b,Aeq,beq,LB,UB,[],options); if exitflag>0 xopt(i,:...

6 years ago | 0

| accepted

Answered
Calculate the midpoint of two lines on a track
The effectiveness of any solution we give will depend on whether the illumination levels of every frame will be similar to your ...

6 years ago | 0

Answered
Preallocation within an optimization loop
xopt=nan(runs,2); %Pre-allocate Total_Private_Profit=nan(runs,2); %Pre-allocate for i = ...

6 years ago | 0

| accepted

Answered
orthagonal planes and normal vectors
format long; A=normalize( [3,2,-1; 3,-8,-7;-22,18,-30] ,2,'norm'); If they are orthogonal, this should give the identity matr...

6 years ago | 1

Answered
Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.699518e-25.
If C is singular, then C is singular and that's all there is to it. However, this will make the same inversion slightly less sin...

6 years ago | 0

| accepted

Answered
How to plot the trajectory that fminsearch follows?
trajectory=doIt(); fcontour(@rosenbrock, [0 3 -3 3],'LineColor', '#00FFFF', 'MeshDensity',50,... ...

6 years ago | 1

| accepted

Answered
Sparse vs Least square solution differ at the edges
Because you forgot to transpose c, s2 = mldivide(full(c.'),b.').';

6 years ago | 0

| accepted

Answered
Drawing upon general, user-created mfiles and .mat files for the Answers forum RUN feature
Here is a test of the technique using an attached mfunction. websave('testfunction', 'https://www.mathworks.com/matlabcentral/a...

6 years ago | 0

| accepted

Question


Drawing upon general, user-created mfiles and .mat files for the Answers forum RUN feature
Thanks to brilliant advice from Ameer Hamza, I have found a way to draw upon URL-posted .mat files as input to the Matlab Answer...

6 years ago | 1 answer | 0

1

answer

Answered
Help me how to find the base of the intersection of two subspaces
If the vectors form the columns of a matrix A and the vectors form the columns of a matrix B, then the basis of the intersecti...

6 years ago | 3

| accepted

Answered
Using blockproc to simply copy an array
Using sepblockfun from the file exchange, https://www.mathworks.com/matlabcentral/fileexchange/48089-separable-block-wise-opera...

6 years ago | 0

Answered
Random number generator with max and min values included in the matrix
I believe your code already works as written. Problem solved?

6 years ago | 1

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

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

6 years ago | 1 answer | 2

1

answer

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

6 years ago | 1

| accepted

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

6 years ago | 0

Load more