Answered
Storing all Loop results in an array?
result(counter)=C;

3 years ago | 0

| accepted

Answered
An error caused by removing the space after the plus sign
I agree it is deceptive, but it happens because the 3rd line of your code is interpreted as an attempt to call a function using ...

3 years ago | 2

Answered
Vectorising conditional for loop
Perhaps as follows, empty_struct_data2_idx = cellfun('isempty', {struct_data2(:).cid}.'); match_idx = find(empty_struct_data2_...

3 years ago | 1

| accepted

Answered
filling a matrix with information regarding angles using atan-function
[X,Y]=ndgrid( -R:2*R/(N-1):R ); [theta, position_matrix]=cart2pol(X,Y);

3 years ago | 0

| accepted

Answered
Fmincon Interior Point Method HessianMultiplyFcn needs Jacobians from Constraint Evaluation
See this doc page: https://www.mathworks.com/help/optim/ug/objective-and-nonlinear-constraints-in-the-same-function.html

3 years ago | 0

| accepted

Answered
How to scale the nonlinear constraints of different orders of magnitude in fmincon ?
You could structure pre-calculate a set of normalization weights like in the following: ceq0=abs( nonleqcon(problem.x0) ); ...

3 years ago | 0

| accepted

Answered
How to find intersection of two line objects in 3D space
You can use pdist2 to find the shortest distance of each point on one curve to the other curve. [D,I]=pdist2(Curve1,Curve2,'eu...

3 years ago | 0

| accepted

Answered
Interpolate matrix in 4D
You can use griddedInterpolant (preferable IMHO) or interpn.

3 years ago | 1

Answered
Unique concatenation of multi-dimensional cell arrays
A(:,:,1) = {[1;2;3],[],[3]; [],[],[4]; [],[2;3],[]}; A(:,:,2) = {[2;3;4],[4],[3]; [],[],[4]; [],[2;4],[]}; ...

3 years ago | 0

| accepted

Answered
Mask with a for loop
removeData([2 3 0 0 7 8 0]) function newVec = removeData(vec) newVec = vec; newVec( vec(1:end-1) & ~vec(2:en...

3 years ago | 0

Answered
Motion Estimation between Blocks from Two Images
I imagine you would use imregtform to do the motion estimation. Once you have the motion tform, you would apply it to the centro...

3 years ago | 0

Answered
Finding the columns that contain 1 and 0s(Basic Columns) in MATLAB
Well, I definiitely don't think you should be using rref, which is a very primitive command. Instead , you should use this FEX d...

3 years ago | 0

| accepted

Answered
Access cell array from input in function
You have misspelled atomsStruct in this line: wantedAtoms= atomsStuct(matchingResNameCells)

3 years ago | 1

Answered
Must dependent properties in abstract class be redefined in every concrete subclass?
If your abstract base class defines the Dependent property, then its get.property() method must also be defined in the abstract ...

3 years ago | 0

| accepted

Answered
How is data characterised as 'spatial or temporal' in the context of neural networks?
The input data is in a cell array with dimensions (320,2) where col 1 is the signal data and col 2 is the label(a 0 or 1). The s...

3 years ago | 0

Answered
Selecting the shorted path between two nodes with prioritized edges
EdgeTable = table(EndNodes,1+Edge_value/1e5,'Var',{'EndNodes', 'Weight'});

3 years ago | 0

Answered
converte the anonymous constraint function using fcn2optimexpr
N=20; x=optimvar('x',N,'LowerBound',-1,'UpperBound',1); y=optimvar('y',N,'LowerBound',-1,'UpperBound',1); z=optimvar('z',N,'L...

3 years ago | 0

| accepted

Answered
How to get around sparse row deletion for least squares calculation
No, probably not. You might try pagemldivide instead, thereby avoiding sparse matrices altogether.

3 years ago | 1

Answered
Referencing an object property within the set method for a different property
This may seem cumbersome to you, but the robust way to deal with this is to make any property that can trigger an event Dependen...

3 years ago | 0

| accepted

Answered
How to fill zeros and NaNs with the average of the previous nonzero consecutive values
Using this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetition...

3 years ago | 1

| accepted

Answered
How to only keep the legends I want
Go into the Parent/Child properties of the locus you want removed from the legend and set HandleVisibility to 'off'. ...

3 years ago | 0

| accepted

Answered
Dividing image in two equal horizontal parts
Left=Image(:,1:round(end/2)); Right=Image(:,round(end/2)+1:end);

3 years ago | 0

Answered
How about matlab size function ?
You have not overloaded the size method appropriately for the case where nargout=1: a = testSizeFunction; siz=size(a) Try t...

3 years ago | 0

| accepted

Answered
optimization: have function return NaN but not at initial point
Setting the objective to NaN should not be seen as a substitute for constraints. If there is a region where your objective funct...

3 years ago | 0

| accepted

Answered
Implementation of an overlap constraint in linear programming problem
Instead of a distance matrix, the columns of A should be a TxN matrix where T is some number of discrete time points over which ...

3 years ago | 1

| accepted

Answered
Concatenating cells according an external vector
A = [7;3;4;13;20;3;1]; B = [11;11;11;15;15;24;24]; E=splitapply(@(x) {x}, A, findgroups(B)); E{:}

3 years ago | 1

| accepted

Answered
Referencing an object property within the set method for a different property
You can create a processNotification() method and do all the necessary property referencing there instead: function pro...

3 years ago | 0

Answered
Find circle in image
How about this (requires this Download), load BWImage BW0=BW; se=strel('disk',5); BW=imclose( bwareaopen(BW,3), se ); BW=...

3 years ago | 0

Answered
How do I use the Levenberg-Marquardt algorithm for lsqcurvefit?
Here's a silly solution to the problem. The fit will be meaningless, however. opts = optimset('Display', 'off'); params0 = [0...

3 years ago | 0

Answered
How do I use the Levenberg-Marquardt algorithm for lsqcurvefit?
If the signal is supposed to be smooth, it would make sense to add some sort of roughness penalty term to the reisduals, e.g., ...

3 years ago | 0

Load more