MATLAB: Fast way to replicate array matrixrepmat I have a matrix W of size ExF, and I have a matrix D of size NxFxNxE where D(n,:,n,:) = W' Is there a fast way to replicate W to form D without having to loop through N Thanks! Best Answer w=[1 2; ... 3 4; ... 5 6];N=5;E=size(w,1);F=size(w,2);D=repmat(reshape(w',1,F,1,E),N,1,N,1); Related SolutionsMATLAB: Confusion on Runge-Kutta method Hi,your function f should have two inputs, namely t and X, where X is a two component vector [x, y]. Therefore your w=1 should in fact be w = [-2 1];Titus MATLAB: 121 by 121 Sparse Matrix temp = repmat({S}, 1, 11);result = blkdiag(temp{:}); Related QuestionVpasolve for three nonlinear equations inside a for loopNeed help optimizing this code…Error using ==> rdivideStrings to text file using num2str,strcat, and fprintf
Best Answer