Answered
Replace elements of a matrix by a smaller matrix which contains circular shaped values margins
C = A; sB = size(B); idx = {1+(1:sB(1)),1+(1:sB(2))}; % adjust offset 1 and 1 if B to be moved at other place C(idx{:}) = B ...

7 years ago | 0

| accepted

Answered
How to compute a Hankel matrix for N-dimension ?
Not sure what is the Hankel in 4-D but by extension in 2D it should be something like this w=5; x=4; y=3; z=2; b = rand(1,w...

7 years ago | 0

| accepted

Answered
How to fit ellipse equation through segment of ellipse?
Warning: you won't ever get reilable ellipse with such as small portion of data. I'll still provide you a code (Optimization ...

7 years ago | 3

Answered
How to gracefully truncate a matrix of unknown dimensions?
Input = rand(3,4,5) Dimension = 2; a=2; b=4; commaidx = cell(size(size(Input))); commaidx(:) = {':'}; commaidx{Dimension}...

7 years ago | 0

Answered
Find constraints on polynomial coefficients optimization
Why can't you implement ts := max(min(-a2/(2*a1),T),0); Then add the 6 constraints into your minimization pb: two non-linear ...

7 years ago | 0

| accepted

Answered
Vector decomposition with Matlab
b= [2; 1; 2; 1; 0; 1; 2; 1; 2] b1=min(b,1); b1([find(b==2,1,'first'),find(b==2,1,'last')])=2; b2=b-b1; n=length(b); tail=...

7 years ago | 1

| accepted

Answered
For a multidimensional array is it possible to return all other array dimensions for a single index of one dimension without having to use the colon for indexing?
Mdls = struct(); % Initialise Mdls as struct Mdls = repmat(Mdls,[2,4,6,8,6,4,2]); % Arbitrarily size the struct dim = 3; % dim...

7 years ago | 0

| accepted

Answered
How to find the nearest positive definite matix
First step of preparation is to "symmetrize" the matrix A = 0.5*(A + A') Why? Because MATLAB engine selects the algorithm depe...

7 years ago | 1

Answered
What is the best way to generate samples from a multivariate complex normal distribution with an arbitrary covariance matrix?
% Generate test complex covariance matrix R sdp (m x m) m = 3; A = randn(m)+1i*randn(m); R = A'*A % Generate x, n-samples ...

7 years ago | 1

Answered
Should I set my bounds in the main function call or in the constraints function in global optimization?
In the lb, ub if you can. Then in linear constraints. then in non-linear constraints. Don't do in the main function. ...

7 years ago | 0

| accepted

Answered
how can i separate a matrix into a multiplication of two matrices One of Real Values and the Other for Integer values.
Of course. Test matrix X = rand(5) n = length(X) then Z = ceil(1000*rand(n,n)) Y = X/Z Y*Z

7 years ago | 1

| accepted

Answered
How to apply function eig to an array of matrices?
If your matrices is 2x2 or 3x3 you can use this FEX for eigen values, then this one for engen vectors.

7 years ago | 0

Answered
mcr2018a version 32
TMW stops 32-bit MATLAB since R2016a

7 years ago | 0

| accepted

Answered
Compare values of a matrix
It seems like you you want to cluster indexes according to correlation. In this case why not threshold you matrix, that gives so...

7 years ago | 0

Answered
Find the intersection of two surfaces.
The mesh intersection is reduced to basic triangle-triangle intersection. There are few good pointers here: https://stackoverfl...

7 years ago | 1

Answered
Binary matrix in Matlab
If you have communications toolbox, create galois field array (with m=1) then apply inv.

7 years ago | 0

| accepted

Answered
How to solve a special linear equation Ax=b? A is a row vector.
If you have optimization toolbox A=[0.1+0.2i 0.2+0.3i 0.4+0.5i 0.6+7i 0.8+0.9i] b = 0.5+0.7i; nz = 2; AA = [real(A); imag(...

7 years ago | 1

| accepted

Answered
Formulating maximization problem subject to null-space constraint
FMINCON (or any optimizer) cannot solve this kind of problem, your asmmissible space is not close set, since the constraint can ...

7 years ago | 0

Answered
sum of multiplication for a vector and matrix
b*sum(A,2) Less operations than the first solution.

7 years ago | 1

Answered
How to accelerate multiple Backslash Operations?
You might try this FEX

7 years ago | 0

Answered
counting the number of times a number appears next to the same one in a row?
>> A=[1 1 1 2 3 4 4 2] A = 1 1 1 2 3 4 4 2 >> sum(diff(A)==0 & diff([NaN, A(1:end-1)])...

7 years ago | 0

Answered
Quadprog 'interior-point-convex' failure
You can shift the input variable, it seems to work [y,fval,exitflag,output,lambda] = quadprog(H,f,A,b-A*x0,[],[],[],[],[],opts)...

7 years ago | 2

Answered
Unexpected speed decrease of 2D Fourier Transform on GPU when iFFTed
If you want a fast FFT, make your data length power of 2, or product of small integers. 166 is bad since the prime factor is 2 ...

7 years ago | 0

Answered
mex file only found when in working directory, but not when in search path
If the MEX file is compiled with MSVS you might need to install the appropriate Redistributable on the target PC.

7 years ago | 0

Answered
How can I generate a set containing all possible combinations?
A = nchoosek(1:8,4); A = num2cell(reshape(A',2,2,[]),[1 2]); A = A(:); % display A{:} Produces 70 2x2 matrices

7 years ago | 0

Question


New feature Mex Out-of-Process
In the R2019a, there is a new feature that I think it's useful for people like me(us) that uses heavily MEX in the projects. ht...

7 years ago | 1 answer | 4

1

answer

Answered
Create an accurate boundary around 2D point cloud horizontal plane
You might take a look at traveling saleman problem, there are several efficient implementation in File Exchange

7 years ago | 1

Answered
Replace elements of matrix
F = matrix .* ~ismember(matrix,vector)

7 years ago | 1

Answered
How to mask a circle in perspective projection?
@Maayan please make an effort to give feedback to various answer/questions addressed to you. Just update the persective code in...

7 years ago | 1

| accepted

Question


Update and Matlab Compenent Runtime
Does anyone know if the MCR installer (for compiled version of a code) gets an update whenever the regular MATLAB get an update ...

7 years ago | 1 answer | 1

1

answer

Load more