For example, vector A is a 3×1 and has the value 1 in its third row. I want to then take the sum of the entire vector A and put this sum in a 3×5 matrix B (currently filled with NaN's) in the first column third row. I want to keep doing this for each subsequent column– so for a second round, if vector A (3×1) has the value 1 in the first row, I want to put the sum of all numbers into the second column first row of matrix B.
MATLAB: How to select the row of an element in a vector and put it in the same row for a different matrix
matrixrowrowsvector
Best Answer