Answered
Array Problem How can I unpack an array? why the firt element pf my array is always 0?
To unpack, you can do [I1,I2,I3]=deal( I(1), I(2), I(3) ) or, Icell=num2cell(I); [I1,I2,I3]=Icell{:}

2 years ago | 0

Answered
Can I apply branch and bound and use linprog function to minimize a function? if there is an example please share it
Add additional binary variables b1,b2 and equality constraints as below. Then it becomes a straightforward application of intlin...

2 years ago | 0

Answered
Saving resized figures in loop does all but last correctly
Maybe use export_fig or exportgraphics, instead of saveas.

2 years ago | 0

| accepted

Answered
Saving resized figures in loop does all but last correctly
Maybe issue a call to drawnow? h = findall(groot, 'Type', 'figure'); for numFig = 1:length(h) figure(numFig) s...

2 years ago | 0

Answered
How to remove thin lines in binary image
Image=imopen(Image,ones(3));

2 years ago | 1

Answered
Plot a Cuboid with a cylindrical shaped hole in 3D
[X,Y,Z]=meshgrid(-150:150); V=(X.^2+Y.^2>=80^2 & max(abs(X),abs(Y))<=120); V(:,:,[1,end])=0; V=V+0.5*imerode(V,ones(3,3,3...

2 years ago | 1

Answered
How can the plot be divided into 2 using the graph line?
Perhaps you can find the nearest point on the boundary line with pdist2, then make a decision based on whether the nearest point...

2 years ago | 0

Answered
How to deal with the Hermitian matrix that is meant to be positive semidefinite but turned out to have negative eigenvalue due to numerical issues?
You can add a small multiple of eye(N) to raise the eigenvalues above zero F=F+small_number*eye(size(F))

2 years ago | 0

Answered
How can I solve a nonlinear matrix equation, and get the possible _matrices_ as my output, instead of a struct of 1-dimensional solutions?
I would like to solve for the matrix P directly instead ... Is this possible to do? No, but the manual work of assembling P at ...

2 years ago | 0

| accepted

Answered
How to use a sliced cell array as a reduction variable in parfor?
The update terms like logErrOuter_1(logErrOuter_1(:,2) == j,3) need to be the same size in every iteration i in order to be comp...

2 years ago | 0

| accepted

Answered
Repeat coordinates (arranged on the same y and different x) over different values of y
load row_c ; load val x=row_c(:,1); y0=row_c(1,2); %%% Engine [X,Y]=ndgrid(x, flip(y0-cumsum(val))); scatter(X(:),Y(:)...

2 years ago | 0

Answered
Evaulating a multiple valued function at multiple points
Another way is to make it so that the time variable t is vector-valued as well: syms t [1,4] f(t)= t.^(1:4) Times=3:6; %e...

2 years ago | 0

Answered
Evaulating a multiple valued function at multiple points
Is there some way to call my acceleration function with the (vector valued) min accel time in a single line or command? Yes, On...

2 years ago | 0

Answered
Multiply matrices in cell array by another matrix
If instead of creating A{i}, you can instead create a cell array B such that B{i}=A{i}.' , then it would be much more efficient,...

2 years ago | 0

Answered
Multiply matrices in cell array by another matrix
Using this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/115340-block-transposition-permutation-and-reshap...

2 years ago | 0

Answered
Calling functions that have a variable name
Just generate handles to all the functions. Then they can be used freely to make function calls, e.g., F=cellfun(@str2func, co...

2 years ago | 1

| accepted

Answered
How to represent gray scale images as affine subspaces?
Well, in general, we can write the estimation of A,b as the norm minimization problem, If X can be fit in RAM, you could just...

2 years ago | 0

Answered
Fit ellipsoid to (x,y,z) data
I'm finding that a decent fitting strategy is to first fit with a Gaussian, but then use the parameters of the Gaussian to const...

2 years ago | 1

| accepted

Answered
Fit ellipsoid to (x,y,z) data
Using quadricFit from, https://uk.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-for-fitting-conics-and-q...

2 years ago | 2

Answered
How to plot the best fitted ellipse or circle?
The code below uses ellipsoidalFit() from this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-...

2 years ago | 1

| accepted

Answered
Efficiently calculating the pixels crossed by a ray bundle
I have tried to go from square pixels to circles, I'm assuming the circles are inscribed inside the square pixels? If so, I wou...

2 years ago | 0

Answered
Troubleshooting Title and Axis Label Placement in Log-Log Plot with Dual Axes in MATLAB Live Script
I've marked lines I've added changed below in comments: h = figure(); param = [0.3287,3.5103,1 0.3287,4.5491,2 ...

2 years ago | 0

| accepted

Answered
Remapping problem in order to calculate the estimate of new frame
Check wither map_x or map_y (or both) are outside the boundaries of img_n.

2 years ago | 0

Answered
Minimize multivariable function with multivariable nonlinear constraints in MATLAB
The problem is unbounded. Consider x=[ 14, pi/2, x3,0,0,x6]. Then the problem reduces to the linear program, ...

2 years ago | 0

Answered
How to represent gray scale images as affine subspaces?
One way, I suppose would be to train an affine neural network with the Deep Learning Toolbox, e.g., layers=[imageinputLayer(120...

2 years ago | 0

Answered
Show matrix is not invertible.
syms a b c d e f g h A = [a 0 0 b 0; 0 c 0 0 d; 0 0 e f 0; 0 0 0 0 g; 0 h 0 0 0]; det(A)

2 years ago | 0

Answered
How do I isolate a specific part of an image for quantitative analysis via segmentation
You could have a look at the Image Segmenter App https://www.mathworks.com/help/images/ref/imagesegmenter-app.html

2 years ago | 0

Answered
To mirror (i.e, to copy) the upper matrix to the lower half in matrices arranged in 3D
M_3D=randi(100, 4,4,3); %fake input N=size(M_3D,1); mask=triu(ones(N)); mask(1:N+1:end)=nan; M_3D=M_3D.*mask; M_3D=M...

2 years ago | 1

| accepted

Answered
Combine multiple objects to create Super Sampled representation
Here's an algebraic solution in which we model the blobs as circularly symmetric with a radial profile parametrized by cubic spl...

2 years ago | 0

| accepted

Load more