Answered
Efficient algorithm to compute only the most probable sequences of a random variable out of all possible sequences
Here is a far more efficient version of my original answer based on my recommendation above to avoid explicitly listing permutat...

5 years ago | 0

Question


Is numel() supposed to accept more than one input argument?
I accidentally did numel(A,1) instead of size(A,1) and didn't get an error message to alert me of the mistake. That's fine, I gu...

5 years ago | 2 answers | 0

2

answers

Answered
Efficient algorithm to compute only the most probable sequences of a random variable out of all possible sequences
but it has two major drawbacks....It doesn't generalize to sequences longer than 3. The first drawback at least is easy to fix....

5 years ago | 0

Answered
Efficient algorithm to compute only the most probable sequences of a random variable out of all possible sequences
This might work, but it requires uniqueperms from the file exchange: p=[0.01 0.04 0.95]; S = most_probable_sequences(p, 2, 0.9...

5 years ago | 2

| accepted

Answered
Skip the optimised parameters result if the objective function fails
Most optimization solvers have an OuputFcn option that will let you define your own stopping criteria: https://www.mathworks.co...

5 years ago | 0

| accepted

Answered
Dot indexing is not supported for variables of this type.
In line 18, you clearly epect FileList to be a structure variable, but it isn't. You should check what it actually is.

5 years ago | 0

| accepted

Answered
How to temporarily pause execution of a function for troubleshooting
You can set conditional breakpoints, https://www.mathworks.com/help/matlab/matlab_prog/set-breakpoints.html#buvvmfu-1

5 years ago | 2

Answered
Graph a plane spanned by 2 vectors
You can use the planarFit class methods from this File Exchange submission. https://www.mathworks.com/matlabcentral/fileexchang...

5 years ago | 0

Answered
Move the editor toolbar buttons to the right hand side
I raised this as a suggestion at the recent MAB. Since the panelists didn't mention that it was already possible, I'm going to a...

5 years ago | 0

| accepted

Answered
On my Matlab Desktop UI is a minimize/maximize toggle button. I want minimization/maximization to occur only when I press this button.
I raised this as a suggestion at the recent MAB. Since the panelists didn't mention that it was already possible, I'm going to a...

5 years ago | 0

| accepted

Answered
Creating a binary Matrix from X and Y Coordinates
As long as X and Y are matrix indices, you can do matrix=accumarray([X(:),Y(:)],1,targetSize); where targetSize is the desired...

5 years ago | 0

Answered
How to ask to user if to run or not a part of code?
For example, if inputdlg('Proceed? [Y/N]')=="N" break end There is also uiconfirm, https://www.mathworks.com/help/matlab/r...

5 years ago | 0

| accepted

Question


Shouldn't bwconvhull() be idempotent?
Shouldn't the following two calculations give the same results? load BWimage A=bwconvhull(BW); B=bwconvhull(bwconvhull(BW));...

5 years ago | 3 answers | 4

3

answers

Answered
circle through 3 points equation
You can use circularFit() from this File Exchange submission https://www.mathworks.com/matlabcentral/fileexchange/87584-object-...

5 years ago | 0

Answered
How to solve this simple matricial system?
u=A\(h*G)

5 years ago | 0

| accepted

Answered
Verifying an Vector composition
issorted(A(1:ceil(end/2))) & all(A==flip(A))

5 years ago | 1

| accepted

Answered
how do I select only the segmented region from a original image in MATLAB
You could do, S=regionprops(rgb_label,img,'Image')

5 years ago | 0

| accepted

Answered
Jacobian of a state matrix over time using jacobianest
I don't think there is anything sub-optimal about the way you're using jacobianest now. In fact, by keeping the loop external to...

5 years ago | 0

Answered
Draw a gradient circle within a circle
One way might be to use a patch with vertex interpolation, as in this example. https://www.mathworks.com/help/matlab/ref/patch....

5 years ago | 1

| accepted

Answered
How to extrapolate a level curve form a 3D plot of a 2-variables function?
Youc an just use contour(). contour(Mach,Alfa,CM_plot,0);

5 years ago | 0

| accepted

Answered
Find very small zeros of a polynomial
It would be easier, both numerically and analytically, if you made the change of variables z=-(0.5/r)^6 and find the roots of th...

5 years ago | 0

| accepted

Answered
How can I register (merge) two images using homography matrix?
I'd recommend using fitgeotrans() rather than an unnormalized DLT approach. https://www.mathworks.com/help/images/ref/fitgeotra...

5 years ago | 0

Answered
How to plot 3d plane of type where one variable is missing like x + y = 0.....
If you mean that you have a plane equation of the form a*x+b*y+0*z=d, then you can use https://www.mathworks.com/matlabcentral/...

5 years ago | 0

| accepted

Answered
Array division of two non-zero arrays returns zero
W = double(Y(:))./double(X(:).');

5 years ago | 0

| accepted

Answered
parfeval inside a class method does not update a class property
Couldn't you do something like this? function execute(self, N) gd=gpuDevice; ...

5 years ago | 0

| accepted

Answered
Subset and nanmean of a three dimensional array to a have a 2d array 1xndim
pt_lev8=reshape(pt_lev8,[],348); final = mean(pt_lev8(s1pos,:),1,'omitnan')

5 years ago | 0

| accepted

Answered
parfeval inside a class method does not update a class property
You cannot broadcast handle objects to a parpool. They simply get cloned and used as independent class instances on the workers....

5 years ago | 1

Answered
Zero Steps Performed in lsqcurvefit Calculation for Matrix Optimization Problem
Seems like the problem has a simple analytical solution, [A,B]=eig( D\diag(P)/(D.') ); A=A.';

5 years ago | 0

| accepted

Answered
Image registration and motion correction
Maybe downsample the images to reduce computation and use imregtform() instead of imregister()?

5 years ago | 0

Load more