Answered
Extreme points of a polyhedral set
If the polyhedron is bounded, you can use lcon2vert, downloadable from, https://www.mathworks.com/matlabcentral/fileexchange/30...

4 years ago | 1

Answered
Is there a way to get rid of white dots in image?
medfilt2 would be appropriate. A=imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1129070/image.jpg'); ...

4 years ago | 0

| accepted

Answered
detecting circle using hough tranform
I find that imfindcircles is often hard to parameter-tune. Here's an alternative solution using this circle-fitting tool, https...

4 years ago | 0

Answered
how to generate random number between two numbers ?
rand(1,100);

4 years ago | 0

Answered
How to find sx and sy and F intrinsix matrix in camera calibration
You can only find the focal length if you know the pixel sizes at the image plane. There's probably no way you can get it, but I...

4 years ago | 1

| accepted

Answered
How to efficiently find and step through similar values in a vector.
Download this, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetitions-in-vecto...

4 years ago | 0

| accepted

Answered
Class handler to call static methods
h=@(varargin) feval([vehHand '.MakeSound'],varargin{:}); h(arg1, arg2,...,argN)

4 years ago | 0

Answered
how can generate an adjacent rectangle ?
You haven't said how the rectangle is being represented as a Matlab variable. If it is a polyshape object , you can use translat...

4 years ago | 1

| accepted

Answered
Solve implicit equation for isentropic flow
For example Aratio=4, g=1.4, the true result is M=2.94 We can see below that M=2.94 is not a solution, so either you have atypo...

4 years ago | 0

Answered
App Builder uses class definitions that are not backwards compatible to 2018b. Is there a way to force it to use older class definitions?
GUIDE has an option to generate code. Does AppDesigner have something similar? I hadn't thought so, but apparently, it does. ...

4 years ago | 1

| accepted

Answered
How to return value to zero before index of specific element in matrix?
m=4;n=8; Matrix=rand(m,n), V=[3;7;2;5]; Matrix=Matrix.*((1:n)>=V),

4 years ago | 0

| accepted

Answered
Problem fitting with lsqcurvefit
Your model has 3 unknowns w(1), w(2), and w(3). However, you are only providing initial guesses x0 for 2 of these variables.

4 years ago | 1

Answered
find the corresponding x and y coordinates
i=100; x=-179:0.02:-175; y=10:0.02:20; [j,k]=ind2sub([numel(x),numel(y)], i); xi=x(j) yi=y(k)

4 years ago | 0

Answered
How do I plot this set as 3d region in matlab?
This will plot the hull for x=y=0; Looks pretty convex (as we knew it must be). x=0;y=0; fcn=@(u,v,z)x.^2+y.^2+u.^2+v.^2-z + 0...

4 years ago | 1

| accepted

Answered
Get array of elements based on occurrences of another vector
y=[0;1;2;3;4]; x=[1;1;2;2;2]; z=splitapply(@(x){x},y,x); z{:}

4 years ago | 1

Answered
nargout unavailable in anonymous functions when run from Live Script
Tech Support has classified it as "a bug in MATLAB Live Editor for 'nargout' function".

4 years ago | 1

| accepted

Question


nargout unavailable in anonymous functions when run from Live Script
The following code works fine at the command line and in mfile scripts. >>f=@()nargout >> f() ans = 0 >> a=f()...

4 years ago | 1 answer | 2

1

answer

Answered
Calculate the largest, smallest diameter and the centroid of a polyshape (irregula rpolygon) from a set of points
For the centroid, polyshape has a method centroid. If the min and max feret diameters are what you want, then one approach wou...

4 years ago | 0

| accepted

Answered
How to evenly distribute number of points in a non linear line made itself by number of points with different distances
See interparc: https://www.mathworks.com/matlabcentral/fileexchange/34874-interparc

4 years ago | 1

Answered
Mulitpling a scalar to specfic numbers in a vector
One way: [1 3 5 10 15 17 20 25 30].*repelem([2,5,10],3)

4 years ago | 1

| accepted

Answered
Newton iteration doesn't run smoothly
Possibly, you meant to have, if (abs(x-x0)) <= eps

4 years ago | 0

Answered
Nonlinear constraints not respected in optimization
Nonlinear constraints are only satisfied at convergence, and then only within the tolerance settings that you've specified. Yo...

4 years ago | 1

Answered
3d Matrix - Extract Subarray and Multiply by Conjugate Transpose without Forloops
[m,n,p]=size(A); Ar=reshape(A,[],p).'; UU = reshape(Ar,p,1,[]).*conj(reshape(Ar,1,p,[])); UU=reshape(UU,p,p,m,n); %obta...

4 years ago | 1

| accepted

Answered
What is the best and quick way to find the intersections points set of two 3d surfaces?
You can to download this FEX submission, https://www.mathworks.com/matlabcentral/fileexchange/74010-getcontourlinecoordinates?s...

4 years ago | 0

| accepted

Answered
Rotation of ellipsoid using matrix
You just compute the angle between one of the eigenvectors with the x or y axis.

4 years ago | 0

| accepted

Answered
Matrices with variable dimension
A=[1,0.1;0 1]; B=[0.005;0.1]; [n,m]=size(B); z=zeros(n,m); C=repmat({z},N+1,1); C{2}=B; for i=3:N+1 C{i}=A*C{i-1}; ...

4 years ago | 0

| accepted

Answered
How to do Double numerical integration with a variable limits
I'll demonstrate for a simpler function. The technique is the same regardless of what function we're integrating. F=@(x,y,z) x....

4 years ago | 0

| accepted

Answered
How to pass user-defined gradients for anonymous non-linear constraints in fmincon
I suspect you've misled yourself into believing the functions must be defined anonymously. I don't know of any situation where t...

4 years ago | 0

| accepted

Answered
Fitting Data to a Square root Cruve
k=sqrt(x(:))\y(:)

4 years ago | 2

| accepted

Load more