Answered
How to define plane in 3d cube. Intersection point of segment with plane in 3d cube
Use intersectionHull() and addBounds from this FEX download: https://www.mathworks.com/matlabcentral/fileexchange/30892-analyze...

4 years ago | 0

Answered
How to transform a vector to a matrix with same position ?
A=A( ismember(sum(A,2),V) ,:)

4 years ago | 0

| accepted

Answered
The PARFOR loop cannot run due to the way the variable is used
Pre-allocate temporary variables like diff within the parfor loop. parfor permi = 1:npermutations diff=nan(M,N); %pre-al...

4 years ago | 0

| accepted

Answered
Generate a large almost diagonal matrix
N=10; e=ones(N,1); A=spdiags([e,-e],[0,1],N,N); full(A)

4 years ago | 0

Answered
Generate a large almost diagonal matrix
N=10; A=eye(N)-diag(ones(1,N-1),1)

4 years ago | 0

Answered
Find X and Y coordinates of white pixels in a grayscale image
You will first need to get rid of the horizontal line of white pixels near the top, load Image Image(1:20,:)=0; Image=bwprop...

4 years ago | 0

| accepted

Answered
Question about calling user defined function to another script
It returns empty. %r=[-100:0.01:100]; V=10; A_execute1(-100) Don't use global variables. Use anonymous functions, or othe...

4 years ago | 0

| accepted

Answered
Camera Intrinsics for camera 2 not returned by estimateCameraParameters.
Hmmm. It seems like it might be a version-related problem. When I run your code in R2022a, I get intrinsics for both cameras: >...

4 years ago | 0

Answered
How to build a circularly symmetric matrix from a vector
x=discretize(1:100,5); %hypothetical input plot(x); axis padded a=normalize(1:2*numel(x)-1 , 'center'); [~,R]=cart2pol...

4 years ago | 0

Answered
how to count words in a cell array
ca = {{'Let it go'} {'Let it go'} { 'Can''t hold it back anymore'}}; NumWords = cellfun(@(c)sum(c{1}==' ')+1,ca)

4 years ago | 0

Answered
possible to reduce the relative difference for CheckGradients in optimization (fmincon)?
This FEX download allows you to obtain the results of the finite differencing, as well as to decide where (at what x) you want i...

4 years ago | 0

| accepted

Answered
combining varying uneven matrices
N=min(size(A,1), size(B,1)); A=A(1:N,:); B=B(1:N,:);

4 years ago | 0

| accepted

Answered
Compute the mean of a bucket
bins = discretize(A(:,1),5); averages = splitapply(@mean,A(:,2), bins)

4 years ago | 0

Answered
Manipulation of cell to convert into a matrix
Perhaps this is what you want? A = {[5] [1,1,0] ;[4] [0,0]} A_convert = cellfun(@(c) join(string(c),''), A) Or perhaps as fol...

4 years ago | 1

| accepted

Answered
How to color the space between ellipse?
fn=@(r) scale( nsidedpoly(1000,'Radius',r) ,[1,2] ); region=subtract(fn(2),fn(1)); plot(region); axis equal; axis([0,4, 0,...

4 years ago | 0

Answered
Maximal thickness of 3D triangulated part
Use alphaShape on the boundary points of the region. Basically, you would apply alphaShape() with increasingly larger alpha radi...

4 years ago | 0

Answered
How do I extract means for a column based on multiple groups of rows in another column
For such small data sizes, I would splurge and just compute look-up tables of all the moving averages that could possibly be req...

4 years ago | 0

| accepted

Answered
How do I apply an operation to certain elements in a row vector (that are less/more than a given value)
S=0; for k=1:A region1= (0 <= x) & (x <= Va(k)) ; region2= (Vb(k) < x) & (x <= L) & ~region1; Q1 =...

4 years ago | 0

Answered
Question about making a 4-line if statement into a single line
if rand > 0.5, disp('Great indeed!') ; end

4 years ago | 0

| accepted

Answered
Gradient of L2-norm using dlgradient
Why do that, when the gradient is analytically known? function [y, dy] = fun_and_deriv(x,theta) delta=theta-x; y...

4 years ago | 0

| accepted

Answered
how to generate multiple curves with the same track length
Using interparc from the File Exchange https://www.mathworks.com/matlabcentral/fileexchange/34874-interparc?s_tid=srchtitle f...

4 years ago | 1

Answered
Vertically-stacked subplots cannot be made the same width and to be vertically aligned
Something to do with daspect(). Omitting it gives the intended edge alignment. Units='normalized'; h1 = subplot(2, 1, 1); %...

4 years ago | 0

| accepted

Answered
How to Search a struct array?
Perhaps this is what you meant? somedata = alldata([alldata.ID]=="864475047572713")

4 years ago | 0

| accepted

Answered
How do I return the index of a vector I am defining?
In normal Matlab practice, you would vectorize withinBounds so that the operation could be done like this: e1_v1_parameters = [...

4 years ago | 0

Answered
How do I extract the first non-zero value from array after specified number of zeros?
Using this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetition...

4 years ago | 0

Answered
Tiledlayout with separate tile spacing in rows and columns?
It's not possible with tiledlayout, but this FEX download offers that kind of control: https://www.mathworks.com/matlabcentral/...

4 years ago | 1

| accepted

Answered
rotate points on a line
You can imitate the following example. h=plot(1:5,'--x'); center=[2,2,0]; for i=1:10:360 rotate(copyobj(h,h.Parent),...

4 years ago | 1

| accepted

Answered
How to generate surface from scatter3 with xyz coordinates and specified color
Perhaps as follows, [x,y,z]=deal(tbl.pred1,tbl.pred2,tbl.pred3); T = delaunay(x,y); trisurf(T,x,y,z)

4 years ago | 0

Answered
Interpolation between two 2D projective geometric transformations
You could trysomething like this, c=0.5; t3=projective2d(c*t1.T+(1-c)*t2.T) though I don't have a mathematical proof, off the...

4 years ago | 0

| accepted

Answered
Finding equation of a plane using three points as well as using noisy data
You can use planarFit() in this FEX download https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-f...

4 years ago | 0

Load more