Answered
segment the vessels in the attached image
load Images B=bwareaopen(A>170,100); montage({A,B})

4 years ago | 0

Answered
calculate distance matrix for 3D points
Assuming xA, yA, zA, xB, yB, zB are column vectors, D=pdist2([ xA, yA, zA],[xB, yB, zB])

4 years ago | 0

Answered
How can you remove all sub-graphs that are not part of the largest component of connected sub-graphs?
Given a agraph, G, bins=biconncomp(G); [~,cmaj]=max(histcounts(bins,1:max(bins)+1)); ekeep=find(bins==cmaj)...

4 years ago | 0

| accepted

Answered
How to smooth a curve with movmean with consideration of the start and end of an array?
k=ones(1,301); k(8192)=0; for i = 1:1:8 tmp=fwd.Offset_itpl_mean{i}(:).'; tmp=ifft(fft(tmp).*fft(k),'sy...

4 years ago | 0

Answered
How Can I remove lines from the below images?
For the first image, I recommend bwlalphaclose() from, https://www.mathworks.com/matlabcentral/fileexchange/90762-further-tools...

4 years ago | 0

Answered
Building a graph from a matrix
Given an upper triangular matrix B Isn't B your adjacency matrix? If so, then why not just, G=graph(B);

4 years ago | 0

| accepted

Answered
Calculate adjusted R2 for constant model
R2=1-mean((y-constant).^2)/var(y);

4 years ago | 0

| accepted

Answered
Is there any way to get the uigetfile panel to be centered in the monitor when it first comes up????
If you drag the uigetfile window to the location where you want it then, the next time you call uigetfile, it will open in that ...

4 years ago | 0

Answered
Deriving rotation angle from the eigenvectors
If you download ellipsoidalFit() to do the fitting, the yaw-pitch-roll angles are avaialble directly from the object, https://w...

4 years ago | 0

Answered
Solving matrix equations?
You can try fsolve, but you will need a good initial guess, X0. X=fsolve(@(X) A1-A2*X+X*A3-X*A4*X, X0)

4 years ago | 1

| accepted

Answered
Conversion of a binary matrix to decimal matrix
A = [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0;0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0]; e=kron(speye(2),2.^(7:-1:0)'); B = A*e

4 years ago | 1

Answered
Speedup of mldivide by parallelisation
mldivide is already highly well-optimized internally, without the need for an explicit parpool. It is not clear how distributing...

4 years ago | 0

| accepted

Answered
Optimization problem not finding the actual optimal value
Making sure you don't have any round(), ceil(), floor() or other discretization operations in your simulation code. Also, make s...

4 years ago | 0

| accepted

Answered
Mathworks: it's time for a dark theme.
Is a dark theme different from just setting the color preferences to black background and white text?

4 years ago | 1

Answered
How can I find the number of specific submatrices inside a matrix?
Sa=conv2(A.^2,ones(2),'valid'); Sb=sum(B(:).^2); n= nnz( conv2(A, rot90(B,2),'valid').^2==Sa.*Sb );

4 years ago | 1

| accepted

Answered
how to covert an irregular shape into an equivalent filled square?
Like in this example, perhaps. load Image imshow(Image) reg=regionprops(Image>0,'PixelIdxList','BoundingBox'); I=ceil(...

4 years ago | 0

Answered
how to get convolution for two signals without using conv command
You're probably meant to use the convolution property of FFTs.

4 years ago | 0

Answered
Converting parallel CPU processing into GPU processing
I would like to process matrices in a cell array on the GPU in parallel for how many cores are present on the gpu. No, GPU core...

4 years ago | 0

Answered
Diagonal cross section of function z(x,y) for x=y
fcn=@(t) arrayfun(@(x) z(x,x), t); fplot(fcn)

4 years ago | 0

Answered
Select less value from matrix than proviusly selected
{A,B]=deal(zmiana); while ~isempty(A) & ~isempty(B) % V1 is the first value V1=A(randi(numel(A))); A(A>=V1)=...

4 years ago | 0

Question


Is there a way to obtain handles to the last N figures that were opened?
Sometimes, I have M figure windows open and I want to access only the last N<M of them. Is there any way to assess how recently ...

4 years ago | 1 answer | 0

1

answer

Answered
How to acces the value of a Optional-Positional argument (~ argument) ?
The ~ doesn't mean the input is optional. It means the function doesn't care what it is. Since your function does care, use a n...

4 years ago | 0

| accepted

Answered
Evaluate the intersection area between the circles and the rectangle with increasing number of circles(N) with increasing number of random distribution samples(qty)?
Currently, with N>1 you have more centers than you do radii. Also, you have not organized the data as a cell array.The area cal...

4 years ago | 0

Answered
Adding specific elements in a vector
e=1:max(a(:,1))+1; e([2,22:24,26:38])=[]; G=discretize(a(:,1),e); result=accumarray(G,a(:,2))

4 years ago | 0

| accepted

Answered
fmincon pause after 2 iterations when using gradients
I get my gradients from a different script by taking the symbolic jacobian of ceq, and using matlabFunction to generate a sparse...

4 years ago | 0

Answered
How do I find the indices of nonzero elements for a matrix of logical vectors?
A=[1 0 0 0; 0 0 1 0; 0 0 0 1]; [~,w]=max(A,[],2)

4 years ago | 0

| accepted

Answered
Labels on plot lines
Using the text() command? clear t Vkts = [120,110,100,90,80,70,60,50]; Vms = Vkts/1.944; Hdata=0:0.15:0.6; figure(1) ...

5 years ago | 0

| accepted

Answered
How to display a polygon and its centroid
close all, imshow(I), for k = 1:3 title(['Polygon # ' int2str(k)]); h = drawpolygon; wait(h); ...

5 years ago | 0

| accepted

Answered
How to evaluate the union area of the multiple circles plotted in matrix form of centers and radii?
An approximate calculation can be made as follows, C={centreG1,centreG2,centreG3,centreG4,centreG5,centreG6}; p=cellfun(@pol...

5 years ago | 2

| accepted

Answered
How to solve :'Error using prod. Invalid data type. First argument must be numeric or logical.'
We've no way of running your code, but I'm pretty certain if you just examine, K>> class(children(Term(ll))) all will be clea...

5 years ago | 0

Load more