Answered
Give gradient to fmincon
If the problem is constrained, the gradient in a local extremum usually is not 0. In fact, if the gradient is non-negative on t...

4 years ago | 0

| accepted

Answered
Split one image into multiple images
Assuming you have the Image Processing Toolbox, image = [ 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

4 years ago | 1

| accepted

Answered
Weird problem in while loop: What is wrong with the input "48" compared to "47" and "49"????
It's because 48 is the ASCII code for '0'. double('0') char(48) 48=='0'

4 years ago | 2

| accepted

Answered
Difficulty fitting translation and rotation between two matrices of coordinate points
This FEX download handles your posted data pretty well, https://www.mathworks.com/matlabcentral/fileexchange/26186-absolute-ori...

4 years ago | 1

| accepted

Answered
curve fitting in MATLAB by using curve fitting tool
The centering/scaling means the xdata,ydata will be pre-normalized before any fitting is done. The doc is not specific about wha...

4 years ago | 1

| accepted

Answered
Solve system of equations depending on other syms variables
Plus I need to specify the variables to eliminate and not the ones that the solution should depend on. Just because you are abl...

4 years ago | 0

Answered
Solve system of equations depending on other syms variables
This version solve(eqns, [x,z]) is correct because it communicates to solve() that x is not a constant. With solve(eqns, z), th...

4 years ago | 0

| accepted

Answered
How can I use fzero on these two functions?
If you are going to transform the function, you must restrict the search to the domain where the transform is valid, f=@(x) log...

4 years ago | 0

Answered
Estimation of variables from the inequality and equality constraints
Since there are only 3 variables, you can do a discrete sweep of the bounded box described by lb, ub to find points that satisfy...

4 years ago | 0

Answered
String with mask parameter
For example, "item" + (0:3)' + "/" + ["pump1" "pump2" "cold_valve" "hot_valve"]

4 years ago | 0

| accepted

Answered
Define a variable on a spline
n = 3; n1 = n-1; a = 20; b = 10; P = [0 b;0 0;a 0]; x = P(:,1); y = P(:,2); T ...

4 years ago | 0

| accepted

Answered
fitting parabolic looking data to an exponential function
Nothing is wrong with your code, but I recommend using the built-in 'exp1' model instead, which doesn't require a start point. ...

4 years ago | 0

Answered
How to fit my data with a custom equation meant to come out as a parabola?
If there are 3 coefficients, you should just use polyfit(x,y,2) and forget about lsqcurvefit. No reason an iterative solution is...

4 years ago | 0

Answered
How to find the nearest points from 2D image?
Just use pdist2 or bwdist.

4 years ago | 0

Answered
Optimisation problem not solving for maximum values
We can easily do a discrete sweep over the allowable d and t values to see where the feasible region is, approximately. Based on...

4 years ago | 0

Answered
How to fill the markers in a plot?
Z = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1147865/Experimental_data_botheq.xlsx') ; data = ...

4 years ago | 1

| accepted

Answered
is it possible to use function without toolbox
You can also call Python optimizers from Matlab, like https://docs.scipy.org/doc/scipy/reference/optimize.html

4 years ago | 0

Answered
find angle of propagation in matlab
https://www.cuemath.com/geometry/angle-between-vectors/

4 years ago | 0

Answered
is it possible to use function without toolbox
If you have the Matlab Compiler product, then you can deploy your code as a standalone application. Your end-users do not need a...

4 years ago | 0

| accepted

Answered
linear inequality constrains based on absolute values
The constraints correspond to a non-convex region in (as Walter's second plot shows). You would have to break it into two regio...

4 years ago | 0

| accepted

Answered
Change description in File Exchange contribution
No, there is no way to edit any part of your FEX submission without upping the version number. I'm not sure it would be a good ...

4 years ago | 0

Answered
Remove unwanted area of image ?
A=im2gray(imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1147135/image.png')); A(205:260,:)=[]; im...

4 years ago | 0

| accepted

Answered
RANSAC Algorithm on dense points
I would just histogram the y-coordinates of all the points. Then you can just use find() to get the first and last point where t...

4 years ago | 0

Answered
linear combination of vector and permutation
One way: A=[-1,1];B=3; [Out{1:B}]=ndgrid(A); Out=reshape( cat(B+1,Out{:}),[],B)

4 years ago | 1

Answered
How to pair two set of coordinates together based on their Euclidean distance?
See matchpairs. The cost matrix can be obtained using pdist2.

4 years ago | 0

Answered
Coming back from gradient using circshift for image processing
No, you cannot. Any constant image, for example, has the same "gradient", so the process cannot be invertible.

4 years ago | 0

| accepted

Answered
Given a center, sum adjacent pixels
Use interp2: value=interp2(A,14.3,10.6)

4 years ago | 0

Answered
UseParallel for hessian?
I don't speak for MathWorks, but I think the issue is that finite difference Hessians are only relevant to the trust-region algo...

4 years ago | 0

Answered
Why does my FFT highly depends on the resolution of the data?
The fft of a guassian should return a guassian as well. Remember, the FFT and the continuous Fourier transform are not the same...

4 years ago | 0

Load more