MATLAB: Converting vector to matrix MATLABsimulink Am beginner to this please tell me is there any function to convert vector to matrix. vec=[0:4.80314960629921e-6:.00061] which gives values from column 1 to column 128. i want to convert it to a matrix of 8 rows 16 columns. Best Answer reshape(vec,16,8)' Related SolutionsMATLAB: How to convert a matrix into one single column vector B = reshape(A',[],1); MATLAB: How to move elements of vector Could use a loop on the rows with logical indexing. E.g.,vec = whateverz = (vec == 0);for r=1:size(vec,1) vec(r,:) = [vec(r,~z(r,:)) vec(r,z(r,:))];end Related QuestionHow to convert a vector [256 by 1] into 16 by 16 matrixConverting 2d matrix to 3dHow to remove the ranges from a specific column vectorHow to reshape this matrixTurning a matrix into a vector issue where it truncates (easy question)I need the best way to write the loop commands
Best Answer