Answered
Bending point of a curve
The pgonCorners function from this FEX download https://www.mathworks.com/matlabcentral/fileexchange/74181-find-vertices-in-im...

3 years ago | 0

Answered
Collapsing a structure by combining field names
[A,B,C]=ndgrid("Forceplate"+(1:4),... ["Force","Moment","COP"], ... ["X","Y","Z"]); clear new...

3 years ago | 0

| accepted

Answered
Bending point of a curve
BW=load('Image').BW; [Y,X]=find(BW); [~,is]=sortrows([X,Y],2); X=X(is); Y=Y(is); m=bend(X,Y); m=bend(X(1:m), Y(1:m));...

3 years ago | 0

Answered
register axis to point cloud
This paper does something quite similar. https://www.researchgate.net/publication/224380689_Compensating_for_head_motion_in_slo...

3 years ago | 1

Answered
Determine the inner volume of a cylinder-like body
If you import the STL as an alphaShape, you can use the volume() command to get its volume. You can then use convhulln() to get ...

3 years ago | 0

| accepted

Answered
How can I sort columns of a matrix based on the order of where the minimums occurs?
Assuming A is your matrix, [~,imin]=min(A,[],1); [~,is]=sort(imin); A=A(:,is);

3 years ago | 0

| accepted

Answered
Rotate 3-D Point Cloud Using Rigid Transformation
Using AxelRot from this File Exchange download, https://www.mathworks.com/matlabcentral/fileexchange/30864-3d-rotation-about-sh...

3 years ago | 0

| accepted

Answered
I want to plane fit my sperical data points.
You can use sphericalFit() from this FEX download https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-to...

3 years ago | 0

Answered
Minimizing linear equation Ax=b using gradient descent
[X1,X2]= meshgrid(-5:0.2:5); x=[X1(:)';X2(:)']; E=vecnorm( A*x-b, 2,1); E=reshape(E,size(X1)); %if desired

3 years ago | 0

| accepted

Answered
Is it possible to fix some parameters when fitting a gaussian mixture model using fitgmdist.m?
If you have the Curve Fitting Toolbox, you can run a fit using the 'gauss2' model, https://www.mathworks.com/help/curvefit/list...

3 years ago | 1

| accepted

Answered
String containing variables to numerical array
f=str2func("@(X,Y) " + InputFunction); surf(X,Y,f(X,Y))

3 years ago | 0

| accepted

Answered
Computing error for solution to linear equation
x= A\b; E=norm(A*x-b)^2

3 years ago | 0

| accepted

Answered
from 0 1 matrix to boundaries and vertices
A=load('domain').domain; A=imresize(A,1/20); BW=logical(A); A(BW)=2; BW=bwmorph(BW,'remove'); A(A&~BW)=1; BW=ed...

3 years ago | 1

| accepted

Answered
What is the fastest way to spline-interpolate every entry between 4 N x N-arrays?
Even more vectorization: R=interp1([k1, k2, k3, k4], [A(:),B(:),C(:),D(:)]',t,'spline'); R=reshape(R, size(A));

3 years ago | 0

| accepted

Answered
how to increase 'MaxFunEvals'
The problem is that integral2 does not support an option called 'MaxFunEvals'. You imagined somehow that it does.

3 years ago | 0

| accepted

Answered
How to save all variables in the matlab base workspace by a button in App?
It is not clear what you mean by, "the Matlab workspace". I will assume you mean the base workspace, i.e., the workspace of the ...

3 years ago | 1

| accepted

Answered
90° clockwise rotation of 2D coordinates
2nd way (using rotation matrix, more convenient): Your implementation of this has several problems: You try to rotate by 90 ...

3 years ago | 1

| accepted

Answered
90° clockwise rotation of 2D coordinates
matrix = importdata('matrix.txt'); p=polyshape(matrix(:,1), matrix(:,2),'Simplify',1); [cx,cy]=centroid(p); prot=rotate(p...

3 years ago | 1

Answered
how to split 6x4 double based on first columns values into three [2X4]?
A=[4 1 2 3 4 5 6 7 5 1 2 3 5 4 5 6 5 4 5 6 5 4 5 6 6 1 2 3 6 4 5 6]; A=unique(A,'rows'); Acell=splitapply(@(x){x}, ...

3 years ago | 0

| accepted

Answered
how to split 6x4 double based on first columns values into three [2X4]?
A=randi(9,6,4) Acell=mat2tiles(A,[2,4]); %get mat2tiles from https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2t...

3 years ago | 0

Answered
Determine positions of projected points onto an ellipse
Use the ellipseprj function below. It requires the download of trustregprob from the file exchange https://www.mathworks.com/ma...

3 years ago | 0

| accepted

Answered
A simple way to find (in a cell array) rows that, once flipped, are duplicates of other rows?
n=numel(a); map=false(n); for i=1:n for j=i:n map(i,j)=isequal(a{i},flip(a{j})); end end [I,J]=find(m...

3 years ago | 1

| accepted

Answered
Calculating coordinates of a pixel in a rotated image
Rather than fussing with your own rotation matrices, you should probably be using imregister or imregtform. In any case, using ...

3 years ago | 0

Answered
function outprod.m
Perhaps this is what you want? n=3; A=randn(n); %random square matrix A=A'*A; [V,D]=eig(A);%find eigenvalue ...

3 years ago | 1

Answered
Enumeration class properties: How to limit possible values? How to use default values?
Question 1: How can I not tell to use some properties default values in enumeration setup? I would set a value of nan in the en...

3 years ago | 0

Answered
Projecting a dataset on an ellipse
This code requires the download of trustregprob from the file exchange https://www.mathworks.com/matlabcentral/fileexchange/531...

3 years ago | 0

Answered
Find the rows have two same elements from a matrix
Use edges to get a list of all the edges of the triangulation. Then loop over the list and use edgeAttachments.

3 years ago | 0

Answered
Why am I getting inf even though there is no divide by zero?
I am also not able to take the sum of the elements of array 's' as that gives this error: 'Array indices must be positive intege...

3 years ago | 0

| accepted

Answered
Call class A method from class B using function handle?
function obj = MainClass() obj.Prop1 = ClassB; obj.Prop1.SetMethod(@()obj.MyMethod); ...

3 years ago | 0

| accepted

Answered
I wrote this function, which should calculates the values of the linear interpolation
function [ X, Y ] = linterp( a, b, Xl, n ) % Xl = [xmin, xmax] X = linspace( Xl(1), Xl(2), n + 1 ) ; Y = a*X + b ; end

3 years ago | 0

| accepted

Load more