Answered
How to access struct member via a string
Here is something simiilar: airplane.cockpit.controls.throttle = 'forward'; s={'cockpit','controls'}; getfield(airplane,s...

2 years ago | 0

| accepted

Answered
"TiledChartLayout cannot be a parent." error message using pdeplot with tiledlayout
You can control the compactness of subplots using this, https://www.mathworks.com/matlabcentral/fileexchange/3696-subaxis-subpl...

2 years ago | 0

Answered
histogram for each column of 3d matrix
Something like this, perhaps: A=rand(8,8,1000); binwidth=0.1; %Fake input data edges=0:binwidth:1; Hist=num2cell(resha...

2 years ago | 0

| accepted

Answered
Linear Interpolation code without using interp1
function ynew = interpolate(n,x,n2) %Doesn't use interp1 F=griddedInterpolant(n,x); ynew=F(n2); end

2 years ago | 0

Answered
Linear Interpolation code without using interp1
n=1:8; x=rand(size(n)); n2=[1.8, 3.2, 6.7]; interp1(n,x,n2) interpolate(n,x,n2) function ynew = interpolate(n,x,n2) ...

2 years ago | 1

Answered
Plot a struct field that is an array of doubles
plot([data.BO], vertcat(data.tota),'o')

2 years ago | 0

| accepted

Answered
Nesting of tiledlayout objects not possible in R2019b?
I also looked into the documentation and found nothing about changes regarding Children and Parents since introduction in R2019b...

2 years ago | 2

Answered
Optimization in a for loop
Perhaps this is what you wanted. If so, it is a rather ill-posed problem, because your C matrix is only rank 1. %Input data (ou...

2 years ago | 0

| accepted

Answered
Values on plot do not match manually inputted values for an anonymous function.
Your defintiion of t is not using element-wise ./ and .* operators.

2 years ago | 0

| accepted

Answered
Moving sum with variable window
x = 1:20; y = [1 2 3 4 2 5 3 7 2 4 5 4 7 6 3 9 5 5 3 6]; n=numel(x); c=[0,cumsum(x)]; s=c(2:end)-c((2:n+1)-y)

2 years ago | 3

| accepted

Answered
How can I make a plate rotates around the central axis.
This should be helpful: https://www.mathworks.com/matlabcentral/fileexchange/30864-3d-rotation-about-shifted-axis

2 years ago | 0

| accepted

Answered
lsqnonlin (interior-point) vs fmincon (interior-point): different converged solutions
It's a non-convex problem, so it can have multiple solutions, some possibly local/sub-optimal. There is no guaranteeing that dif...

2 years ago | 0

Answered
For-loop finding the difference between 7 different arrays
T=cat(3, t1,t2,t3,t4,t5,t6,t7); A = T-tref;

2 years ago | 0

Answered
Calculating the differences of elements in an array
tsorted = sort(t-t(1))

2 years ago | 0

| accepted

Answered
Why is assignment with RedefinesParen so slow
Here is the proper way to time the operations. The difference isn't that big. x = TestCustomParen; x.X=rand(500); y=x.X; a...

2 years ago | 1

| accepted

Answered
No of cores selection
And I use MATLAB 2022b. I want my MATLAB to use all the cores avaialable. That should happen automatically. And I want to us...

2 years ago | 1

Answered
Summing a 30x30x30 matrix.
Download sepblockfun from, https://www.mathworks.com/matlabcentral/fileexchange/48089-separable-block-wise-operations A = ones...

2 years ago | 0

Answered
Advice constructing large sparse Jacobian arrays
I am undertaking non-linear optimization of tensor b spline coefficients used to describe thermodynamic surfaces. I suggest loo...

2 years ago | 0

Answered
calculate the normal for a plane passing through more than three points
Use planarFit() from this FEX package, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-for-fit...

2 years ago | 0

Answered
Why is fminimax not accepting sparse constraint matrix data?
Tech Support says it's a documentation bug. fminimax doesn't do sparse.

2 years ago | 0

| accepted

Answered
Set constraint for plot with two points that force him to go through a circle
% I have the following input data that is fixed: % 4 Points P{1}= [-18.595112081112493,1.050302529300339e+02,-72.160383747947...

2 years ago | 0

| accepted

Answered
Cone fitting in Matlab
Consider using rightcircularconeFit(), which is non-iterative, from this FEX download, https://www.mathworks.com/matlabcentral/...

2 years ago | 0

| accepted

Answered
how do I fill between 3 lines?
One way: b = 48; time = 0:1:40000; mFast = 6/30 ; mSlow = 4.3/30; yFast = (mFast*time)+b; ySlow = (mSlow*time)+b; plot(...

2 years ago | 0

| accepted

Question


Why is fminimax not accepting sparse constraint matrix data?
From the documentation for fminimax, it appears that fminimax is supposed to accept constraint matrices in sparse form, e.g., ...

2 years ago | 1 answer | 2

1

answer

Answered
What will be a suitable option to circumvent a non-invertible matrix?
The approach is valid if A is symmetric, positive definite, but 1e-10 may not be large enough to add substantial conditioning.

2 years ago | 0

Answered
Curve fitting for 4 independent variables
If you have four unknown variables, you need four lb(i). Upper bounds would also help. Also, you should address the fact that y...

2 years ago | 0

Answered
The simplify function is not completely simplifying my polynomials.
syms x prob2 = ((3*x-4)*(x^2-2*x+4)); problem2 = expand(prob2)

2 years ago | 0

Answered
Why does the "fsolve" function in Optimization Toolbox not converge when using a quadratic cost function?
Very often, quadratic functions have no roots to find, e.g., fsolve(@(x) abs(x).^2+1, [1+1i;0+3i])

2 years ago | 0

Answered
use the 'patch' function with different results (using different matrices)
If you are trying to recover the boundary from a surface triangulation, then, load trace [~,P]=freeBoundary(delaunayTriangul...

2 years ago | 0

| accepted

Answered
Using an anonymous function handle as input into another function handle
It has nothing to do with nesting of hte handles. If you don't call an anonymous function with inputs, it can't return anything ...

2 years ago | 0

Load more