Answered
Fitting curve with lsqnonlin (find global result), (and) multistart
This gives a better fit. I consider it very lucky that it worked at all, since your objective is not differentiable. % Badly s...

5 years ago | 1

Question


Nesting tiledlayouts within another tiledlayout
I would like to created a tiledlayout and, within each of the tiles, start another tiledlayout. I assume this kind of nesting is...

5 years ago | 2 answers | 2

2

answers

Question


Why aren't these two polyshape objects equal?
The attached .mat file contains two polyshape objects which, according to the following, are not equal load pgons isequal(pi...

5 years ago | 1 answer | 0

1

answer

Answered
Intersection area polygon 3D
b1=(Q-P)/norm(Q-P); b2=(S-P)/norm(S-P); pgon1=polyshape( ([A;B;C;D]-P)*[b1;b2].' ) pgon2=polyshape( ([P;Q;R;S]-P)*[b1,b2].'...

5 years ago | 0

Answered
A Problem of Image Registration
Use fitgeotrans tform = fitgeotrans(movingPoints,fixedPoints,'affine')

5 years ago | 0

Answered
Getting the line equation of hexagon (with different number of divisions)
You can use vert2lcon in, https://www.mathworks.com/matlabcentral/fileexchange/30892-analyze-n-dimensional-convex-polyhedra

5 years ago | 1

| accepted

Answered
Force constant slope in linear regression
Since you know the slope, m, it should be the same as fitting a constant term to y-m*x. mdl = fitlm(x,y-m*x,'constant')

5 years ago | 0

| accepted

Answered
Optimize variables of one curve to match another curve
lsqcurvefit may work. It depends how smooth the curve varies with the design variables.

5 years ago | 0

Answered
How to save a matlab figure into a tiff file?
imwrite(boundary_image.cdata, ['Boundary.tif']);

5 years ago | 1

| accepted

Answered
Is this a bug in eig?
It's fine. You just need to disable balancing: a = [-1,-1,0;1,0,0;0,1,0]; for e=[10e-32, 9e-32] a(1,3) = e; [v,d...

5 years ago | 1

| accepted

Answered
Refer to structure names
args = [fieldnames(A).'; {table1, table2, table3,...}] B=struct(args{:})

5 years ago | 1

Answered
steepest descent algorithm in Matlab
One way would be to transform the problem into an unconstrained one via the change of variables, x1=6+3*sin(z1); x2=6+3*sin(z2...

5 years ago | 0

Answered
Function of a matrix of variables
Assuming X are the unknowns, then the function is quadratic. In the absence of constraints, a quadratic function cannot have bo...

5 years ago | 0

Answered
ifft on gpu returns wrong values
Your criterion for agreement is too strong: A = fft2(gpuArray(rand(10,10,5))); A1 = ifft2(A); A2 = ifft(ifft(A,[],2),[],1); ...

5 years ago | 0

| accepted

Answered
Interpolating non-independent values
Assuming you had moderately tight upper and lower bounds U and L on the time increments t(j+1)-t(j) of the xy data set, I can so...

5 years ago | 0

Answered
Minimising coefficients using fminsearch, subject to normalisation condition
You do not need iterative minimization to solve this problem, assuming your c(i) are not constrained to be positive (which seems...

5 years ago | 0

Answered
Gradient Descent - fix
Call your function with all 5 input arguments.

5 years ago | 1

| accepted

Answered
Fill in array with different lengths of variables at different locations
Of course, my condition is different but this is the same flow of question. No, the solution will very much depend on the rule...

5 years ago | 1

Answered
L1-Norm Minimization Problem
Your fit fails because you need an additional unknown variable to model the non-zero y-intercept of the line. I am also not too ...

5 years ago | 0

| accepted

Answered
Get all allowed values of a class property
Below is a rather gymnastic way of extracting the list (I admit it would be nice if this were unnecessary): classdef myclass %...

5 years ago | 1

| accepted

Answered
I want to know the starting index of consecutive negative elements and also thier count.
Using this File Exchange submission, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutiv...

5 years ago | 0

Answered
how to rotate the 3D
flipud should not have failed, but it does flip, not rotate, the image. If you want a rotation, you can do rot90(yourImage,2) ...

5 years ago | 0

| accepted

Answered
How to remove a 2d array from a 3d array?
LargeArray = LargeArray(:,:, any(LargeArray,[1,2]));

5 years ago | 0

| accepted

Answered
fftn on GPU array
before getting each fftn, I have 10 GB free on the GPU But wit the array dimensions you've mentioned the result will consume m...

5 years ago | 1

| accepted

Answered
How to convert a vector to be a string
string(mat2str([1,2,3,4,5]))

5 years ago | 0

| accepted

Answered
How to use lsqcurvefit for a sine wave?
fminspleas would probably work well for this problem. https://www.mathworks.com/matlabcentral/fileexchange/10093-fminspleas fu...

5 years ago | 0

Answered
How to format an array so all numbers are the same length
For example, A=rand(5).*randi(40,5); T=num2str(A,' %.5f |'); T=[ repmat('| ', size(T,1),1) T]; disp ' ', disp(T), di...

5 years ago | 0

| accepted

Answered
"Solve" for optimization problem does not store linear parameters
Have you looked at what sol contains? I'm willing to bet it contains values for lam, but not c. Your objective F2 is only a func...

5 years ago | 0

Answered
Accessing order pair from sparse matrix
yes, just use find(). [I,J,Vals]=find(S);

5 years ago | 0

Answered
Does MATLAB optimize or calculate the Hessian of a scalar function directly when using the hessian function?
If by "directly" you mean analytically or symbolically, then yes, that is how hessian() operates.

5 years ago | 0

| accepted

Load more