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...

4 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

4 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...

4 years ago | 1

| accepted

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

4 years ago | 0

| accepted

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

4 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...

4 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));

4 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.

4 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 ...

4 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 ...

4 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...

4 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}, ...

4 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...

4 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...

4 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...

4 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 ...

4 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 ...

4 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...

4 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...

4 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.

4 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...

4 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); ...

4 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

4 years ago | 0

| accepted

Answered
How to take an exponential to a non-integer value?
You have created a variable named "exp" prior to the code you've shown. It needs to be cleared.

4 years ago | 1

Answered
Having trouble getting my gaussian filter to display filtered image.
% Load the image and convert it to grayscale if necessary img = imread('cameraman.tif'); if size(img, 3) == 3 img = rgb2g...

4 years ago | 0

| accepted

Answered
Trying to run my code in GPU
Your code isn't gettng the benefit of the GPU because you are not applying any parallelized functions to your gpuArray, A. In th...

4 years ago | 0

| accepted

Answered
How to standardize an array so that the maximum value is 1 and minimum is -1 keeping the zero value as zero?
A=[-1 -2 -3 -4 0 1] I=logical(A); StdA=A; StdA(I) = rescale(A(I),-1,1)

4 years ago | 0

Answered
generate 3d periodic geometry matlab
P=scale(nsidedpoly(1000),[1,2]*0.1); X=P.Vertices(:,1); Y=P.Vertices(:,2); Z=0*X; for i=1:30 patch(X+rand,Y+rand,Z+rand,'b'...

4 years ago | 0

| accepted

Answered
How to compute the centriod of a 2D gaussian
Download gaussfitn, https://www.mathworks.com/matlabcentral/fileexchange/69116-gaussfitn >> [X,Y]=ndgrid(1:10); >> params=ga...

4 years ago | 0

Answered
determine the outermost coordinates of a 3D object
Use freeBoundary

4 years ago | 0

Load more