MATLAB: N-dimensional arrays are not supported. matrixoptimization Hello All I have a 3d matrix as below: [l,r,h3]=size(H) When I want to write eye(), as follows, I get an error. Aeq=[H1 -eye(l)] The error is: N-dimensional arrays are not supported. How can I solve it? thanks Best Answer I have no idea what you’re doing or what result you want, or what ‘H’ or ‘H1’ are.This runs without error:H = randi(9,2,2,4); % Create ‘H’[l,r,h3]=size(H);H1 = H; % Assume ‘H1’ = ‘H’Aeq=[H1 -repmat(eye(l), 1, 1, h3)] % Desired Result?Perhaps some variation on this will work for you if this does not. Related SolutionsMATLAB: Repmat N = 2; % The number of times each element will repeat... h2 = reshape(repmat(h,N,1),1,N*length(h)) MATLAB: In an assignment A(:) = B, the number of elements in A and B must be the same. What issize(max)size(Cindex)both must be the same. Related QuestionL1 Optimization in matlabHow to create a 2×2 matrix[SOLVED] How to customise a vector to run in a certain orderConstruction of shifted matrix from known matrixVectorization of for loop and multidimension array
Best Answer