Answered
how does fmincon deal with ill-conditioned problem?
It depends how badly conditioned your objective is. Most fmincon algorithms are some variation of Newton's method, which helps a...

2 years ago | 0

Answered
transform the number cell so that only numbers (with or without decimals) excluding zeros are visible
You can round all of the numbers to 2 decimal places as below. This will make it so that any number that was an integer to 2 dec...

2 years ago | 0

Answered
transform the number cell so that only numbers (with or without decimals) excluding zeros are visible
If your're just looking for a way to change the display format, and not the numbers themselves, I think you can only do that in ...

2 years ago | 0

Answered
Solve many similar fmincon problems with a fully Vectorized Objective function and Analytical gradient + hessian
To vectorize, you must, (1) Sum the elements of f, not take its norm. (2) Vectorize your constraints and their gradien...

2 years ago | 0

Answered
Creating new field names within a new structure when trying to reshape data
Your post is hard to follow, so I'm doing a bit of guessing as to what you want. Regardless, I think the data organization strat...

2 years ago | 1

| accepted

Answered
Problem-based Optimization: Constraint sum(x==1) >=1 doesn't work.
I think it would be better to formulate it like this: A = [1 2 3; 0 3 0]; [rowA, colA] = size(A); k=zeros(3); k(...

2 years ago | 2

| accepted

Answered
Finding a specific value in Y-axis value with known X-axis value
Alt = [11000,12000,13000,14000,15000,16000,17000,18000]; % Altitude [m] Relative_density_ISA = [0.2971,0.2537,0.2167,0.1851,0.1...

2 years ago | 1

| accepted

Answered
How to apply calculation over multiple columns in a matrix
The code you've posted already does it, after transposition. x = linspace(0,100,length(presentMatrix)); y = 0:100; newMatrix=...

2 years ago | 2

| accepted

Answered
How to convert string to optimization variable?
I ended up using "eval" function to solve this issue, but I know "eval" is not recommended. If you have many optimvars, then pi...

2 years ago | 0

Answered
My vectors are not the same length
t=linspace(0,500,numel(L.actual_ver));

2 years ago | 1

Answered
Fitting to 4D data
Yes, you can use lsqcurvefit.

2 years ago | 0

| accepted

Answered
How do i plot this with different domain other than unit disk?
syms z a b X(z)=atan(z); Y(z)=z/(z^2 + 1); Z(z)=sym(1/2) - 1/(2*(z^2 + 1)); X(a,b)=subs(X,z,a+...

2 years ago | 0

| accepted

Answered
Correlation between matrices with different dimensions (spatial resolution)
You can use imresize3 to resampe the arrays at a common resolution.

2 years ago | 0

Answered
Using optimisation function "fminunc" for nth number of time
It is because the n that you pass to objectiveFcn(x,Y,freq,n) is being overwritten by n=3 inside your objective function code. ...

2 years ago | 0

Answered
Trying to index into a cell array using columns of a matrix
I am trying to use two columns in a matrix Call this matrix I. to index into a cell array. Call it C. Then you could do, a...

2 years ago | 0

| accepted

Answered
Draw a curve defining the bounds of a scatter plot to detect anomalous (sparse or low density) points
Sets=["xy1" "xy2" "xy3" "xy4"]; Factors=[20,20,5,5]; for i=1:numel(Sets) xy=load(Sets(i)).(Sets(i)); ...

2 years ago | 0

| accepted

Answered
Pass existing object to different class objects
It will be a "pointer", until you make a change to one of the shared copies. Then, the specific property variables that you chan...

2 years ago | 0

| accepted

Answered
Problem 2022. Find a Pythagorean triple
function flag = isTherePythagoreanTriple(a, b, c, d) X=[a,b,c,d]; X=X(nchoosek(1:4,3)); flag=any( X...

2 years ago | 0

Answered
Problem 2022. Find a Pythagorean triple
function flag = isTherePythagoreanTriple(a, b, c, d) a2=a^2; b2=b^2; c2=c^2; d2=d^2; if a2+b2==c2...

2 years ago | 0

Answered
sorting by foor loops
You have many choices, https://en.wikipedia.org/wiki/Sorting_algorithm

2 years ago | 0

Answered
Finding exact point on the surface
z = fzero(@(z)y-f(x,z), [z1,z2])

2 years ago | 1

| accepted

Answered
Parallelizing For Loops - Issue
I would use parfor just to run the n gurobi optimizations. After you've collected all the results in a struct array Results(jr),...

2 years ago | 1

Answered
Using rdivide for multidimensional matrices
Using the KronProd class, downloadable from here, https://www.mathworks.com/matlabcentral/fileexchange/25969-efficient-object-o...

2 years ago | 0

Answered
Using rdivide for multidimensional matrices
One way: Fp=permute( F([1,3,5],[2,4,7],:), [1,3,2]); Fp_transformed= pagerdivide( Fp , basisVectorMat); F_transform...

2 years ago | 0

| accepted

Question


A MEX solution to split classdef-defined object arrays into cells
As an experiment with MEX files, I am trying to create a mex routine that will take an array A of classdef-defined objects and r...

2 years ago | 1 answer | 0

1

answer

Answered
I don't know why you're saying it's an invalid expression. Help me
Perhaps you intended to have this, y1=sin(x.^2); y2=cos(x).^2;

2 years ago | 0

| accepted

Answered
trainNetwork - training data format
With your imageInputLayer network, try, XTrain =reshape(XTrain.', 24,1,1,N); so that the format of the input is SxSxCxB.

2 years ago | 0

Answered
fmincon with handle function input
The problem is that it is not an explicit function, so it seems that fmincon never stops finding the minimum It is possible th...

2 years ago | 1

Answered
How to rotate a pointcloud data and align parallel with y-z axis?
yz=readmatrix('CS_DATA.xls','Range',[1,2]); [~,v1]=min(yz*[+1;+1]); [~,v2]=min(yz*[-1;+1]); [x1,y1,x2,y2]=deal(yz(v1,1), ...

2 years ago | 2

| accepted

Load more