Réponse apportée
Much slower valid convolution using complementary size of kernels.
I would suggest to do specific conv with MEX programing. Not sure the chance to beat MATLAB though.

plus de 5 ans il y a | 0

Réponse apportée
Is there any method to accelerate many small matrix and vector's "mldivide" (4*4)?
I have submitted fast method FEX file MultipleQRSolver (C-compiler required) that can carried out the job in 1.5 second, 15 time...

plus de 5 ans il y a | 0

Réponse apportée
How to create an N-ary array
N=3 K=5 [~,A] = ismember(dec2base(0:N^K-1,N),['0':'9' 'A':'Z']); A = A-1

plus de 5 ans il y a | 0

Réponse apportée
How to a='10101111' convert array b=[1,0,1,0,1,1,1,1]
>> a='10101111' a = '10101111' >> a-'0' ans = 1 0 1 0 1 1 1 1

plus de 5 ans il y a | 3

Réponse apportée
How to average along all permutations of a 4D array?
A=randn(10,10,10,10); p=num2cell(perms(1:4),2) B=cellfun(@(p) permute(A,p), p, 'unif', 0); B=mean(cat(5,B{:}),5);

plus de 5 ans il y a | 1

Réponse apportée
set order of elseif
prefered_order = 'xzy'; b = [x y z]; % logical conditions (in if/elseif) code_to_be_exec = { @xcode, @ycode, @zcode }; % cod...

plus de 5 ans il y a | 2

Réponse apportée
Creating a non-square diagonal matrix
B = diag(A(:)); B(94037,1) = 0;

plus de 5 ans il y a | 1

Réponse apportée
Generating matrix with ones and zeros
Look at KRON >> kron(eye(4),ones(1,3)) ans = 1 1 1 0 0 0 0 0 0 0 0 0 ...

plus de 5 ans il y a | 0

Réponse apportée
Quadratic Spline Interpolation Code
My toolbox provide any order (1D) spline, including quadratic https://www.mathworks.com/matlabcentral/fileexchange/25872-free-k...

plus de 5 ans il y a | 0

Réponse apportée
is this repr.m redundant to existing standard approach?
A decend tool https://www.mathworks.com/matlabcentral/fileexchange/29457-serialize-deserialize A true matlab serialization is...

plus de 5 ans il y a | 0

Réponse apportée
3 equations 4 unknowns
>> M=[0 1 6; 4 0 4; 0 1 0]; >> [X,K]=eig(M); >> k=1./diag(K); % select 3rd eigen vector for example >> X(:,3) ans = ...

plus de 5 ans il y a | 0

Réponse apportée
Whats the difference between the two statements
The second creates 2-row matrix. The first creates 2-column matrix, since it make a transpose after reshape.

plus de 5 ans il y a | 0

Réponse apportée
Alternative to blkdiag and mat2cell functions
[I,J] = ndgrid(1:Nb,1:Nc); C = accumarray([I(:),J(:)+(I(:)-1)*Nc],A(:));

plus de 5 ans il y a | 0

Réponse apportée
Alternative to blkdiag and mat2cell functions
What about about a simple for-loop [Nb,Nc] = size(A); C = zeros(Nb,Nb*Nc); for r=1:Nb C(r,(r-1)*Nc+(1:Nc)) = A(r,:); en...

plus de 5 ans il y a | 0

Réponse apportée
Inexplicable different execution speeds when filling a matrix with complex entries
I also dig deeper into this "issue" of slowness. The strange issue I discover is that when filling with real values into a comp...

plus de 5 ans il y a | 0

| A accepté

A soumis


Set partition
List all partitions a set n elements

plus de 5 ans il y a | 1 téléchargement |

4.8 / 5

Réponse apportée
Inexplicable different execution speeds when filling a matrix with complex entries
You should preallocate M as complex M = 1i+zeros(m,n); if you intend to populate it with complex number later in the for-loop....

plus de 5 ans il y a | 0

Réponse apportée
Sum of selected elements in Matrix
A=rand(1000); [m,n]=size(A); G=max((1:m)',1:n); s=cumsum(accumarray(G(:),A(:)))

plus de 5 ans il y a | 0

Réponse apportée
Trying to simplify code to see if 3 vectors are at right angle. Unsure of outcome.
>> dot(Q-P,R-P) ans = 0 So PQ is right angle with PR, etc...

plus de 5 ans il y a | 0

Réponse apportée
Excluding one vector from another vector with repetition
From Alexander Gallard above comment (I agree he should open a new thread) "This method didn't work for me if my C was, say, [...

plus de 5 ans il y a | 0

Réponse apportée
How can I create a set from elements and combined elements?
Not sure exactly what kind of "combination" you look for, but it looks like a subset of these b=logical(dec2bin(1:2^4-1,4)-'0')...

plus de 5 ans il y a | 1

Réponse apportée
matrix manupulation and reading diagonally
Matrix_test = [13,10,5,2;7,14,11,6;3,8,15,12;1,4,9,16] [m,n]=size(Matrix_test); [i,j]=ndgrid(1:m,1:n); jmi = j(:)-i(:); [~...

plus de 5 ans il y a | 0

Réponse apportée
Point or multiple points is/are in a triangle??
tf = inpolygon(Points(:,1),Points(:,2),Triangle(:,1),Triangle(:,2))

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Does using Functions make your code run faster?
MATLAB makes optimization when the code is in function, it does not in script (why it's also mysterious to me, there might be th...

plus de 5 ans il y a | 1

Réponse apportée
How to create N+1 dimensional array by taking exterior product of 1st dimension of two N dimensional arrays?
Solution without expansion as requested sizeA = size(A); reshapeB = reshape(B,[1 size(B)]); reshapeA = reshape(A,[sizeA(1) 1 ...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
When is minimum p-norm solution independent of p?
The optimizers fail to initialize find the first feasible point with its gradient and return the same guess, which are identical...

plus de 5 ans il y a | 0

Réponse apportée
Curve fit or spline fit for a wavy function
You can use my tool https://www.mathworks.com/matlabcentral/fileexchange/25872-free-knot-spline-approximation load('RPM.mat') ...

plus de 5 ans il y a | 0

Réponse apportée
How to check 2D rectangle and 3D rectangular prism intersect with each other?
Quick and dirty code load('prism.mat') load('rectangle.mat') % Normalize the coordinates M = prism; minM = min(M,[],1); ...

plus de 5 ans il y a | 0

Réponse apportée
how to write special matrices
>> dec2bin(0:2^4-1)-'0' ans = 0 0 0 0 0 0 0 1 0 0 1 0 0 0 ...

plus de 5 ans il y a | 2

Réponse apportée
Finding shortest path on calculated trajectories via A*
Check out this of you nsist on using A* https://www.mathworks.com/matlabcentral/fileexchange/10922-matlabbgl Otherwise Matlab ...

plus de 5 ans il y a | 0

Charger plus