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

Answered
2nd 3rd derivatives
x = [-2:0.01:1]; y = exp(-3.*x); dy=gradient(y,0.01); ddy=gradient(dy,0.01); plot (x(3:end),ddy(3:end))

4 years ago | 0

| accepted

Answered
How to fill just such successive elements in row of matrix?
Is this what you want? A=[9, 50, 18 3; 11 7 50 10; 1 2 3 50; 50 3 4 5] B=cumsum(A==50,2)*50 C=B+~B.*A

4 years ago | 0

Answered
imfreehand() closes the curve in the image but does not save those "closing" points
Use thte points to contruct a polyshape object, plot(polyshape(points))

4 years ago | 1

Answered
imfreehand() closes the curve in the image but does not save those "closing" points
Copy the first point and append it to the end of the list

4 years ago | 0

| accepted

Answered
To write a For loop in which a variable is updated with each run.
Why not just do, pgon=nsidedpoly(18); pgon.Vertices plot(pgon); axis equal

4 years ago | 2

Answered
cant seem to make the background fully black
A=imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1141370/original.png'); B=imclose(edge(A),strel('dis...

4 years ago | 1

Answered
cant seem to make the background fully black
A=imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1141370/original.png'); B=imquantize(A,multithresh(A...

4 years ago | 1

| accepted

Answered
How to determine if a 3D line segment intersects a side of a 3D rectangular prism?
You can also use Siddon's algorithm https://aapm.onlinelibrary.wiley.com/doi/epdf/10.1118/1.595739 which will compute the int...

4 years ago | 0

Answered
how to remove the tiny white pixels around the rectangles
imopen(yourImage,ones(3))

4 years ago | 0

Answered
how to define a matrix element in matlab
B(1:2,1:2)=A

4 years ago | 0

| accepted

Answered
create a random matrix that satisfies specific criteria (graph theory)
Just permute the rows and columns of the original adjacency matrix, A, [~,is]=sort(rand(264),2); for k=1:264 A(k,:)=A(k,is...

4 years ago | 0

Load more