Answered
Combine a contour plot with a simple 2D plot with same x axis
Is it essential that there be zero space between the upper and lower plots? Why not just a very tight 2x1 tiledlayout? t=tiledl...

5 years ago | 0

| accepted

Answered
Shifting the first element of an array to the end
A=[ 1 2 3 4 ]; B=[A(end),A(1:end-1)]

5 years ago | 0

| accepted

Answered
Problem with indexing in structures
A table would be handier here than a struct: myData=readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/7...

5 years ago | 1

| accepted

Answered
skeletonize image until the end of their borders
I don't think it makes sense to measure line length by counting up individual pixels. What you should probably do is fit a conti...

5 years ago | 0

Answered
Convert line to pixels in a image, from coordenade
One way. T=false(size(BW_image)); T(A(1), A(2))=1; %line end point 1 T(B(1), B(2))=1; %line end point 2 BW_image=BW_imag...

5 years ago | 1

| accepted

Answered
Why do i receive Solving problem using linprog. The dual-simplex algorithm uses a built-in starting point; ignoring supplied X0. Problem is unbounded.
The first part of the message is because you are giving an initial guess x0 to solve(). This x0 is being ignored because it is n...

5 years ago | 1

| accepted

Answered
How to compute projected area of 3D convex hull along specified direction?
Really, all you need is the 3x1 unit direction vector, u, of the projection you want to do. Then, you just project your original...

5 years ago | 1

| accepted

Answered
GlobalSearch and fmincon options
The FunValCheck option is intended to abort the optimization if your objective function code does not return a valid value. It a...

5 years ago | 0

Answered
How to convert 32x32x2x20000 into 20000x1 cell array?
A = rand(32,32,2,20); C=num2cell(A,[1,2,3]); C=C(:)

5 years ago | 0

Answered
Having trouble modifying a figure using homogeneous coordinates
plot(x,y) hold on plot(transformedellipse(1,:),transformedellipse(2,:)) hold off axis([-2 2 -3 3]);

5 years ago | 1

| accepted

Answered
Plane fit in 3d using least squares method
You can use planarFit() from this submisson: https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-f...

5 years ago | 0

| accepted

Answered
How can I fit a nonlinear function to my experimental data to find the unknowns?
Yes, lsqcurvefit is applicable.

5 years ago | 0

| accepted

Answered
How do I do that thing where I get the photo to pop up in a little window?
Perhaps, walk = imread('walkstraight/frame0062.tif'); imshow(walk); shg

5 years ago | 0

| accepted

Answered
Replacing repeated elements in a matrix
Using the downloadables at https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetiti...

5 years ago | 0

| accepted

Answered
Otsu's Threshold Question
I= double(rgb2gray(imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/729084/1-108.png'))); GT = imread('ht...

5 years ago | 0

| accepted

Answered
how to find point of intersection of two curves
x = 0:1:1200; y1 = (6871)*x.^(-1); y2 = 1.5*log(x)-3.417; [~,imin]=min(abs(y1-y2)); xint=fzero(@(x) 1.5*log(x)-3.417 - ...

5 years ago | 0

| accepted

Answered
How can I custom cylinder rotate axis?
Another approach: [Xq,Zq]=ndgrid(linspace(-3,3,100)); [~,Rq]=cart2pol(Xq,Zq); func=@(r) sin(r)./r; %The 1D profile x=li...

5 years ago | 0

| accepted

Answered
How can I custom cylinder rotate axis?
For example, [X,Z,Y] = cylinder(2+cos(0:pi/10:2*pi)); surf(X,Y,Z) xlabel 'X', ylabel 'Y', zlabel 'Z'

5 years ago | 0

Answered
Constraint triangulation without edges
You could use inpolygon to find which points lie within the polygons formed by the red points. Then, triangulate that subset.

5 years ago | 0

Answered
How to select multiple rows from an array and apply some operation iteratively
Well, the efficient way to do the area calculation specifically is, A=T(1:3:end,:).'; B=T(2:3:end,:).'; C=T(3:3:end,:).'; ...

5 years ago | 0

| accepted

Answered
Rendering a 3D shape by stacking 2D layers
One way would be to use fimplicit3: fun=@(x,y,z) (x.^2+y.^2).^(2)-(x.^3+y.^3).*sin(z); fimplicit3(fun); zlim([0,pi])

5 years ago | 0

| accepted

Answered
How to store a new variable based on a range from another column?
X = [-10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10]; Y = [-10, -9, -8, -7, -6, 0, 6, 7, 8, 9, 10]; Y_a=Y(-4<=X & X<=8)

5 years ago | 0

| accepted

Answered
Imported variable is not transferred to fzero- function
Use more modern techniques for specifying the function and passing fixed parameters to it, e.g., a=1; x0 = fzero(@(x) 1./(1+x....

5 years ago | 0

| accepted

Answered
Please help i seem to be failing to understand what the following errors mean and how to correct for them.
Not sure what you are trying to do with ode45. The way you are invoking it does not match any syntax in the documentation. Perha...

5 years ago | 0

Answered
how to scan a matrix row by row and save index of elements
A = [1 2 3 4 0.5 5 6 2 5 3 1 3] ; [I,J]=find(A>2); H=accumarray(I,J,[],@(x){x.'})...

5 years ago | 0

| accepted

Answered
What's an efficient way to do an element-wise multiplication of matrices with different sizes without a permutation or for loop?
Well, if you have a recent version of Matlab, this should be about twice as fast. [mb,nb]=size(B); D=A.*reshape(B,mb,1,nb);

5 years ago | 0

| accepted

Answered
Utilizing "maxk" function in series of vectors
for n=1:col-2 y=numbers(:,col); ys=smooth(y,50,'sgolay',5); [pks,locs] = findpeaks(ys,x,'Min...

5 years ago | 0

| accepted

Answered
Find corners of segmentations with varying number of extremas and tilt
You could try pgonCorners from this submission: https://www.mathworks.com/matlabcentral/fileexchange/74181-find-vertices-in-ima...

5 years ago | 0

| accepted

Answered
How to make the variable pace, a data type double
pace=time/distance

5 years ago | 0

Load more