Answered
Problem with Linear inequality constraints
sum(over j)(xij)<=1 for each i This constraint can be written, x=rand(36); [m,n]=size(x); A=kron(ones(1,n),speye(m)); b=o...

4 years ago | 0

| accepted

Answered
How do you include a figure caption below a graph?
With the text() command you can position text anywhere in or around the axes that you wish.

4 years ago | 0

Answered
Regarding the differentiation of function
x = -10:0.1:10; y = [1 6 0.03 0.08 10]'; A = 23 * (atan((0.005 + y)./x.^2)); B = diff(A,1,2)/0.1; plot(x(1:end-1),B')

4 years ago | 0

| accepted

Answered
How can I trace x, y point of boundary of an image? I need co-ordinate point of the inner and outer boundary only.
bwboundaries does exactly what you're asking for. A=imbinarize( rgb2gray(imread('Image1.png')) ); B=bwboundaries(A); imsh...

4 years ago | 1

| accepted

Submitted


Intersections of multiple 2D lines or line segments
Compute the intersection of a reference line (or line segment) with a polyshape boundary or with a batch of other line segments....

4 years ago | 252 downloads |

4.0 / 5
Thumbnail

Answered
Finding intersection point for polygon with hole
By the way I am trying to find intersection points so that I can discretisize the boundry with additional nodes with linspace fu...

4 years ago | 0

Answered
Error in fsolve function
a=solve(M)

4 years ago | 0

| accepted

Question


Is cell2mat supposed to support non-plaid cell partitioning? If not, why not?
I have 2 cell arrays, load C; C,Ct Why does cell2mat work on one, cell2mat(C) but not the other? cell2mat(Ct) I understand...

4 years ago | 2 answers | 0

2

answers

Answered
Compare cells in cell array to find common columns
You should just use an explicit loop over all combinations of cells. With cell arrays, there is never a good reason to look for ...

4 years ago | 0

| accepted

Answered
How to solve this complicated expression to get real roots?
Based on the plot, the minimum value of the expression would lie somewhere between -0.005 and 0.008, so using fminbnd(), [x,fva...

4 years ago | 0

| accepted

Answered
How to Find Correct Vertice formation for polyxpoly function
Instead of polyxpoly, I would recommend downloading linexlines2D(), https://www.mathworks.com/matlabcentral/fileexchange/93470-...

4 years ago | 1

| accepted

Answered
Assigning X-Y Coordinates to 2-D Matrix
What I think you are trying to do is, [x,y]=meshgrid([0,100,200],[200 100 0]) plot(x(:),y(:),'*'); axis padded

4 years ago | 0

Answered
How to use cat properly
The cat command is not causing the change that you are seeing in the array shape. What's causing it is the fact that you are ind...

4 years ago | 0

| accepted

Answered
take a sum in a matrix and print it on a different row
proctime=[2 1 3 6]; n=numel(proctime); endtime=cumsum(proctime); starttime=[0,endtime(1:n-1)]; table(proctime',starttime',...

4 years ago | 0

| accepted

Answered
How do I extract the vertices to see their position?
polyin{k}.Vertices

4 years ago | 0

Answered
find radius of xyz data
I would like to use inclircle [sic.] function to find the diameter Are you trying to enclose the points in a sphere or a cylind...

4 years ago | 0

Answered
Compute the face normal of the triangle and its normalized equivalent.
A face normal is the vector perpendicular to the plane of the triangle. I have three sides of triangle in vector form [x,y,z] ...

4 years ago | 3

| accepted

Answered
How to count elements in array until criteria is met and output number of elements?
Download this, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetitions-in-vecto...

4 years ago | 0

Answered
Find rows with common values using intersect
Perahps as follows. A=readmatrix('example.txt'); [m,n]=size(A); discard=1:m+1:m^2; p=perms(1:n); np=size(p,1); IJ=cel...

4 years ago | 0

| accepted

Answered
Brute Force for finding optimal value?
fmincon is not brute force, but it would be overkill for a single-variable problem. You should use fminbnd instead. How to do i...

4 years ago | 1

| accepted

Answered
Optimization of weighted sum
You did not include Dconst or the corresponding z, so I eyeballed both from your attached .jpg image. load Dose.mat C=[D1,D2,D...

4 years ago | 0

| accepted

Answered
Given three points in space, how do I get the changed angle of the plane over time?
Given 3 points in the plane P1,P2,P3. u=normalize( P1(:)-P3(:) ,'n'); v=normalize( P2(:)-P3(:) ,'n'); w=cross(u,v); u=cros...

4 years ago | 1

| accepted

Answered
Determining relative angular orientation of vectors
Perhaps as follows? vector = [1 ; 0]; P1 = [-sqrt(0.0075); 0.05]; P2 = [-sqrt(0.0075); -0.05]; new_vec1 = refract(vector,P...

4 years ago | 0

| accepted

Answered
How to do distance formula
A=pdist2(X,X); distances = A( sub2ind(size(A) ,e(:,1),e(:,2) ) )

4 years ago | 0

Answered
How can I straighten a line in an image?
It sounds like what you would want to do is fit the squiggle with two lines that are constrained to be parallel. That can be do...

4 years ago | 0

| accepted

Answered
fsolve no solution found system of two equations
Your function is not differentiable for x(2)<0, so we must impose a lower bound to make it positive. But when we do that as belo...

4 years ago | 0

Answered
Cut a picture as needed
Download mat2tiles and then, Image=rand(900); A=mat2tiles(Image,[300,300])

4 years ago | 2

| accepted

Answered
Condensing code cannnot figure out easier function to use
thresh=30; G=repelem(1:31,300)'; count = sum( accumarray(G(1:numel(differences)),differences(:)) > thresh);

4 years ago | 0

Load more